opendrim-lmp-sensors-1.0.0~ppa/0000755000175000017500000000000011401065455017237 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/0000755000175000017500000000000011401065455025367 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/OpenDRIM_ProcessorVoltageSensor.h0000644000175000017500000010347611401065455033703 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORVOLTAGESENSOR_H_ #define OPENDRIM_PROCESSORVOLTAGESENSOR_H_ #include const static char* OpenDRIM_ProcessorVoltageSensor_classnames[] = {"OpenDRIM_ProcessorVoltageSensor"}; static string OpenDRIM_ProcessorVoltageSensor_NAMESPACE = _NAMESPACE; class OpenDRIM_ProcessorVoltageSensor { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; unsigned short SensorType; bool SensorType_isNULL; string OtherSensorTypeDescription; bool OtherSensorTypeDescription_isNULL; vector PossibleStates; bool PossibleStates_isNULL; string CurrentState; bool CurrentState_isNULL; unsigned long long PollingInterval; bool PollingInterval_isNULL; unsigned short BaseUnits; bool BaseUnits_isNULL; int UnitModifier; bool UnitModifier_isNULL; unsigned short RateUnits; bool RateUnits_isNULL; int CurrentReading; bool CurrentReading_isNULL; int NominalReading; bool NominalReading_isNULL; int NormalMax; bool NormalMax_isNULL; int NormalMin; bool NormalMin_isNULL; int MaxReadable; bool MaxReadable_isNULL; int MinReadable; bool MinReadable_isNULL; unsigned int Resolution; bool Resolution_isNULL; int Tolerance; bool Tolerance_isNULL; int Accuracy; bool Accuracy_isNULL; bool IsLinear; bool IsLinear_isNULL; unsigned int Hysteresis; bool Hysteresis_isNULL; int LowerThresholdNonCritical; bool LowerThresholdNonCritical_isNULL; int UpperThresholdNonCritical; bool UpperThresholdNonCritical_isNULL; int LowerThresholdCritical; bool LowerThresholdCritical_isNULL; int UpperThresholdCritical; bool UpperThresholdCritical_isNULL; int LowerThresholdFatal; bool LowerThresholdFatal_isNULL; int UpperThresholdFatal; bool UpperThresholdFatal_isNULL; vector SupportedThresholds; bool SupportedThresholds_isNULL; vector EnabledThresholds; bool EnabledThresholds_isNULL; vector SettableThresholds; bool SettableThresholds_isNULL; OpenDRIM_ProcessorVoltageSensor() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; SensorType_isNULL = true; OtherSensorTypeDescription_isNULL = true; PossibleStates_isNULL = true; CurrentState_isNULL = true; PollingInterval_isNULL = true; BaseUnits_isNULL = true; UnitModifier_isNULL = true; RateUnits_isNULL = true; CurrentReading_isNULL = true; NominalReading_isNULL = true; NormalMax_isNULL = true; NormalMin_isNULL = true; MaxReadable_isNULL = true; MinReadable_isNULL = true; Resolution_isNULL = true; Tolerance_isNULL = true; Accuracy_isNULL = true; IsLinear_isNULL = true; Hysteresis_isNULL = true; LowerThresholdNonCritical_isNULL = true; UpperThresholdNonCritical_isNULL = true; LowerThresholdCritical_isNULL = true; UpperThresholdCritical_isNULL = true; LowerThresholdFatal_isNULL = true; UpperThresholdFatal_isNULL = true; SupportedThresholds_isNULL = true; EnabledThresholds_isNULL = true; SettableThresholds_isNULL = true; } ~OpenDRIM_ProcessorVoltageSensor() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getSensorType(unsigned short& value) const { if (SensorType_isNULL==true) return NOT_FOUND; value = SensorType; return OK; } int setSensorType(const unsigned short& newValue) { SensorType = newValue; SensorType_isNULL = false; return OK; } int getOtherSensorTypeDescription(string& value) const { if (OtherSensorTypeDescription_isNULL==true) return NOT_FOUND; value = OtherSensorTypeDescription; return OK; } int setOtherSensorTypeDescription(const string& newValue) { OtherSensorTypeDescription = newValue; OtherSensorTypeDescription_isNULL = false; return OK; } int getPossibleStates(vector& value) const { if (PossibleStates_isNULL==true) return NOT_FOUND; value = PossibleStates; return OK; } int setPossibleStates(const vector& newValue) { PossibleStates = newValue; PossibleStates_isNULL = false; return OK; } int getCurrentState(string& value) const { if (CurrentState_isNULL==true) return NOT_FOUND; value = CurrentState; return OK; } int setCurrentState(const string& newValue) { CurrentState = newValue; CurrentState_isNULL = false; return OK; } int getPollingInterval(unsigned long long& value) const { if (PollingInterval_isNULL==true) return NOT_FOUND; value = PollingInterval; return OK; } int setPollingInterval(const unsigned long long& newValue) { PollingInterval = newValue; PollingInterval_isNULL = false; return OK; } int getBaseUnits(unsigned short& value) const { if (BaseUnits_isNULL==true) return NOT_FOUND; value = BaseUnits; return OK; } int setBaseUnits(const unsigned short& newValue) { BaseUnits = newValue; BaseUnits_isNULL = false; return OK; } int getUnitModifier(int& value) const { if (UnitModifier_isNULL==true) return NOT_FOUND; value = UnitModifier; return OK; } int setUnitModifier(const int& newValue) { UnitModifier = newValue; UnitModifier_isNULL = false; return OK; } int getRateUnits(unsigned short& value) const { if (RateUnits_isNULL==true) return NOT_FOUND; value = RateUnits; return OK; } int setRateUnits(const unsigned short& newValue) { RateUnits = newValue; RateUnits_isNULL = false; return OK; } int getCurrentReading(int& value) const { if (CurrentReading_isNULL==true) return NOT_FOUND; value = CurrentReading; return OK; } int setCurrentReading(const int& newValue) { CurrentReading = newValue; CurrentReading_isNULL = false; return OK; } int getNominalReading(int& value) const { if (NominalReading_isNULL==true) return NOT_FOUND; value = NominalReading; return OK; } int setNominalReading(const int& newValue) { NominalReading = newValue; NominalReading_isNULL = false; return OK; } int getNormalMax(int& value) const { if (NormalMax_isNULL==true) return NOT_FOUND; value = NormalMax; return OK; } int setNormalMax(const int& newValue) { NormalMax = newValue; NormalMax_isNULL = false; return OK; } int getNormalMin(int& value) const { if (NormalMin_isNULL==true) return NOT_FOUND; value = NormalMin; return OK; } int setNormalMin(const int& newValue) { NormalMin = newValue; NormalMin_isNULL = false; return OK; } int getMaxReadable(int& value) const { if (MaxReadable_isNULL==true) return NOT_FOUND; value = MaxReadable; return OK; } int setMaxReadable(const int& newValue) { MaxReadable = newValue; MaxReadable_isNULL = false; return OK; } int getMinReadable(int& value) const { if (MinReadable_isNULL==true) return NOT_FOUND; value = MinReadable; return OK; } int setMinReadable(const int& newValue) { MinReadable = newValue; MinReadable_isNULL = false; return OK; } int getResolution(unsigned int& value) const { if (Resolution_isNULL==true) return NOT_FOUND; value = Resolution; return OK; } int setResolution(const unsigned int& newValue) { Resolution = newValue; Resolution_isNULL = false; return OK; } int getTolerance(int& value) const { if (Tolerance_isNULL==true) return NOT_FOUND; value = Tolerance; return OK; } int setTolerance(const int& newValue) { Tolerance = newValue; Tolerance_isNULL = false; return OK; } int getAccuracy(int& value) const { if (Accuracy_isNULL==true) return NOT_FOUND; value = Accuracy; return OK; } int setAccuracy(const int& newValue) { Accuracy = newValue; Accuracy_isNULL = false; return OK; } int getIsLinear(bool& value) const { if (IsLinear_isNULL==true) return NOT_FOUND; value = IsLinear; return OK; } int setIsLinear(const bool& newValue) { IsLinear = newValue; IsLinear_isNULL = false; return OK; } int getHysteresis(unsigned int& value) const { if (Hysteresis_isNULL==true) return NOT_FOUND; value = Hysteresis; return OK; } int setHysteresis(const unsigned int& newValue) { Hysteresis = newValue; Hysteresis_isNULL = false; return OK; } int getLowerThresholdNonCritical(int& value) const { if (LowerThresholdNonCritical_isNULL==true) return NOT_FOUND; value = LowerThresholdNonCritical; return OK; } int setLowerThresholdNonCritical(const int& newValue) { LowerThresholdNonCritical = newValue; LowerThresholdNonCritical_isNULL = false; return OK; } int getUpperThresholdNonCritical(int& value) const { if (UpperThresholdNonCritical_isNULL==true) return NOT_FOUND; value = UpperThresholdNonCritical; return OK; } int setUpperThresholdNonCritical(const int& newValue) { UpperThresholdNonCritical = newValue; UpperThresholdNonCritical_isNULL = false; return OK; } int getLowerThresholdCritical(int& value) const { if (LowerThresholdCritical_isNULL==true) return NOT_FOUND; value = LowerThresholdCritical; return OK; } int setLowerThresholdCritical(const int& newValue) { LowerThresholdCritical = newValue; LowerThresholdCritical_isNULL = false; return OK; } int getUpperThresholdCritical(int& value) const { if (UpperThresholdCritical_isNULL==true) return NOT_FOUND; value = UpperThresholdCritical; return OK; } int setUpperThresholdCritical(const int& newValue) { UpperThresholdCritical = newValue; UpperThresholdCritical_isNULL = false; return OK; } int getLowerThresholdFatal(int& value) const { if (LowerThresholdFatal_isNULL==true) return NOT_FOUND; value = LowerThresholdFatal; return OK; } int setLowerThresholdFatal(const int& newValue) { LowerThresholdFatal = newValue; LowerThresholdFatal_isNULL = false; return OK; } int getUpperThresholdFatal(int& value) const { if (UpperThresholdFatal_isNULL==true) return NOT_FOUND; value = UpperThresholdFatal; return OK; } int setUpperThresholdFatal(const int& newValue) { UpperThresholdFatal = newValue; UpperThresholdFatal_isNULL = false; return OK; } int getSupportedThresholds(vector& value) const { if (SupportedThresholds_isNULL==true) return NOT_FOUND; value = SupportedThresholds; return OK; } int setSupportedThresholds(const vector& newValue) { SupportedThresholds = newValue; SupportedThresholds_isNULL = false; return OK; } int getEnabledThresholds(vector& value) const { if (EnabledThresholds_isNULL==true) return NOT_FOUND; value = EnabledThresholds; return OK; } int setEnabledThresholds(const vector& newValue) { EnabledThresholds = newValue; EnabledThresholds_isNULL = false; return OK; } int getSettableThresholds(vector& value) const { if (SettableThresholds_isNULL==true) return NOT_FOUND; value = SettableThresholds; return OK; } int setSettableThresholds(const vector& newValue) { SettableThresholds = newValue; SettableThresholds_isNULL = false; return OK; } }; class OpenDRIM_ProcessorVoltageSensor_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_ProcessorVoltageSensor_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_ProcessorVoltageSensor_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_ProcessorVoltageSensor_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_ProcessorVoltageSensor_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_ProcessorVoltageSensor_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_ProcessorVoltageSensor_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_ProcessorVoltageSensor_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_ProcessorVoltageSensor_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_ProcessorVoltageSensor_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_ProcessorVoltageSensor_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_ProcessorVoltageSensor_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_ProcessorVoltageSensor_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_ProcessorVoltageSensor_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_ProcessorVoltageSensor_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_ProcessorVoltageSensor_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_ProcessorVoltageSensor_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_ProcessorVoltageSensor_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; class OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_In { public: int SensorReading; bool SensorReading_isNULL; int Accuracy; bool Accuracy_isNULL; unsigned int Resolution; bool Resolution_isNULL; int Tolerance; bool Tolerance_isNULL; unsigned int Hysteresis; bool Hysteresis_isNULL; OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_In() { SensorReading_isNULL = true; Accuracy_isNULL = true; Resolution_isNULL = true; Tolerance_isNULL = true; Hysteresis_isNULL = true; } ~OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_In() {} int getSensorReading(int& value) const { if (SensorReading_isNULL == true) return NOT_FOUND; value = SensorReading; return OK; } int setSensorReading(const int& newValue) { SensorReading = newValue; SensorReading_isNULL = false; return OK; } int getAccuracy(int& value) const { if (Accuracy_isNULL == true) return NOT_FOUND; value = Accuracy; return OK; } int setAccuracy(const int& newValue) { Accuracy = newValue; Accuracy_isNULL = false; return OK; } int getResolution(unsigned int& value) const { if (Resolution_isNULL == true) return NOT_FOUND; value = Resolution; return OK; } int setResolution(const unsigned int& newValue) { Resolution = newValue; Resolution_isNULL = false; return OK; } int getTolerance(int& value) const { if (Tolerance_isNULL == true) return NOT_FOUND; value = Tolerance; return OK; } int setTolerance(const int& newValue) { Tolerance = newValue; Tolerance_isNULL = false; return OK; } int getHysteresis(unsigned int& value) const { if (Hysteresis_isNULL == true) return NOT_FOUND; value = Hysteresis; return OK; } int setHysteresis(const unsigned int& newValue) { Hysteresis = newValue; Hysteresis_isNULL = false; return OK; } }; class OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_Out { public: int Accuracy; bool Accuracy_isNULL; unsigned int Resolution; bool Resolution_isNULL; int Tolerance; bool Tolerance_isNULL; unsigned int Hysteresis; bool Hysteresis_isNULL; OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_Out() { Accuracy_isNULL = true; Resolution_isNULL = true; Tolerance_isNULL = true; Hysteresis_isNULL = true; } ~OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_Out() {} int getAccuracy(int& value) const { if (Accuracy_isNULL == true) return NOT_FOUND; value = Accuracy; return OK; } int setAccuracy(const int& newValue) { Accuracy = newValue; Accuracy_isNULL = false; return OK; } int getResolution(unsigned int& value) const { if (Resolution_isNULL == true) return NOT_FOUND; value = Resolution; return OK; } int setResolution(const unsigned int& newValue) { Resolution = newValue; Resolution_isNULL = false; return OK; } int getTolerance(int& value) const { if (Tolerance_isNULL == true) return NOT_FOUND; value = Tolerance; return OK; } int setTolerance(const int& newValue) { Tolerance = newValue; Tolerance_isNULL = false; return OK; } int getHysteresis(unsigned int& value) const { if (Hysteresis_isNULL == true) return NOT_FOUND; value = Hysteresis; return OK; } int setHysteresis(const unsigned int& newValue) { Hysteresis = newValue; Hysteresis_isNULL = false; return OK; } }; #endif /*OPENDRIM_PROCESSORVOLTAGESENSOR_H_*/ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/OpenDRIM_ProcessorVoltageSensorAccess.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/OpenDRIM_ProcessorVoltageSensorAccess0000644000175000017500000001310111401065455034560 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_PROCESSORVOLTAGESENSORACCESS_H_ #define OPENDRIM_PROCESSORVOLTAGESENSORACCESS_H_ #include "Sensors_Common.h" #include #include "OpenDRIM_ProcessorVoltageSensor.h" int Sensors_OpenDRIM_ProcessorVoltageSensor_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_unload(string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_ProcessorVoltageSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ProcessorVoltageSensor& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& newInstance, const OpenDRIM_ProcessorVoltageSensor& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_RequestStateChange_In& in, OpenDRIM_ProcessorVoltageSensor_RequestStateChange_Out& out, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_SetPowerState_In& in, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_EnableDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_OnlineDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_QuiesceDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_RestoreDefaultThresholds(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_In& in, OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_Out& out, string& errorMessage); int Sensors_OpenDRIM_ProcessorVoltageSensor_populate(OpenDRIM_ProcessorVoltageSensor& instance, int num, string& errorMessage); #endif /*OPENDRIM_PROCESSORVOLTAGESENSORACCESS_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/Makefile.am0000644000175000017500000000412311401065455027423 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_ProcessorVoltageSensorProvider.la libcmpiSensors_OpenDRIM_ProcessorVoltageSensorProvider_la_SOURCES = OpenDRIM_ProcessorVoltageSensorAccess.cpp OpenDRIM_ProcessorVoltageSensorProvider.cpp cmpiOpenDRIM_ProcessorVoltageSensor.cpp libcmpiSensors_OpenDRIM_ProcessorVoltageSensorProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la libcmpiSensors_OpenDRIM_ProcessorVoltageSensorProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ProcessorVoltageSensor.h OpenDRIM_ProcessorVoltageSensor.h OpenDRIM_ProcessorVoltageSensorAccess.h ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/cmpiOpenDRIM_ProcessorVoltageSensor.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/cmpiOpenDRIM_ProcessorVoltageSensor.c0000644000175000017500000005313411401065455034542 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorVoltageSensor.h" CMPIObjectPath* Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ProcessorVoltageSensor& instance) { _E_; Objectpath op(broker, OpenDRIM_ProcessorVoltageSensor_classnames[0], OpenDRIM_ProcessorVoltageSensor_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ProcessorVoltageSensor& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.SensorType_isNULL) ci.setProperty("SensorType", instance.SensorType); if (!instance.OtherSensorTypeDescription_isNULL) ci.setProperty("OtherSensorTypeDescription", instance.OtherSensorTypeDescription); if (!instance.PossibleStates_isNULL) ci.setProperty("PossibleStates", instance.PossibleStates); if (!instance.CurrentState_isNULL) ci.setProperty("CurrentState", instance.CurrentState); if (!instance.PollingInterval_isNULL) ci.setProperty("PollingInterval", instance.PollingInterval); if (!instance.BaseUnits_isNULL) ci.setProperty("BaseUnits", instance.BaseUnits); if (!instance.UnitModifier_isNULL) ci.setProperty("UnitModifier", instance.UnitModifier); if (!instance.RateUnits_isNULL) ci.setProperty("RateUnits", instance.RateUnits); if (!instance.CurrentReading_isNULL) ci.setProperty("CurrentReading", instance.CurrentReading); if (!instance.NominalReading_isNULL) ci.setProperty("NominalReading", instance.NominalReading); if (!instance.NormalMax_isNULL) ci.setProperty("NormalMax", instance.NormalMax); if (!instance.NormalMin_isNULL) ci.setProperty("NormalMin", instance.NormalMin); if (!instance.MaxReadable_isNULL) ci.setProperty("MaxReadable", instance.MaxReadable); if (!instance.MinReadable_isNULL) ci.setProperty("MinReadable", instance.MinReadable); if (!instance.Resolution_isNULL) ci.setProperty("Resolution", instance.Resolution); if (!instance.Tolerance_isNULL) ci.setProperty("Tolerance", instance.Tolerance); if (!instance.Accuracy_isNULL) ci.setProperty("Accuracy", instance.Accuracy); if (!instance.IsLinear_isNULL) ci.setProperty("IsLinear", instance.IsLinear); if (!instance.Hysteresis_isNULL) ci.setProperty("Hysteresis", instance.Hysteresis); if (!instance.LowerThresholdNonCritical_isNULL) ci.setProperty("LowerThresholdNonCritical", instance.LowerThresholdNonCritical); if (!instance.UpperThresholdNonCritical_isNULL) ci.setProperty("UpperThresholdNonCritical", instance.UpperThresholdNonCritical); if (!instance.LowerThresholdCritical_isNULL) ci.setProperty("LowerThresholdCritical", instance.LowerThresholdCritical); if (!instance.UpperThresholdCritical_isNULL) ci.setProperty("UpperThresholdCritical", instance.UpperThresholdCritical); if (!instance.LowerThresholdFatal_isNULL) ci.setProperty("LowerThresholdFatal", instance.LowerThresholdFatal); if (!instance.UpperThresholdFatal_isNULL) ci.setProperty("UpperThresholdFatal", instance.UpperThresholdFatal); if (!instance.SupportedThresholds_isNULL) ci.setProperty("SupportedThresholds", instance.SupportedThresholds); if (!instance.EnabledThresholds_isNULL) ci.setProperty("EnabledThresholds", instance.EnabledThresholds); if (!instance.SettableThresholds_isNULL) ci.setProperty("SettableThresholds", instance.SettableThresholds); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ProcessorVoltageSensor& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ProcessorVoltageSensor& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getProperty("SensorType", instance.SensorType) == OK) instance.SensorType_isNULL = false; if (inst.getProperty("OtherSensorTypeDescription", instance.OtherSensorTypeDescription) == OK) instance.OtherSensorTypeDescription_isNULL = false; if (inst.getProperty("PossibleStates", instance.PossibleStates) == OK) instance.PossibleStates_isNULL = false; if (inst.getProperty("CurrentState", instance.CurrentState) == OK) instance.CurrentState_isNULL = false; if (inst.getProperty("PollingInterval", instance.PollingInterval) == OK) instance.PollingInterval_isNULL = false; if (inst.getProperty("BaseUnits", instance.BaseUnits) == OK) instance.BaseUnits_isNULL = false; if (inst.getProperty("UnitModifier", instance.UnitModifier) == OK) instance.UnitModifier_isNULL = false; if (inst.getProperty("RateUnits", instance.RateUnits) == OK) instance.RateUnits_isNULL = false; if (inst.getProperty("CurrentReading", instance.CurrentReading) == OK) instance.CurrentReading_isNULL = false; if (inst.getProperty("NominalReading", instance.NominalReading) == OK) instance.NominalReading_isNULL = false; if (inst.getProperty("NormalMax", instance.NormalMax) == OK) instance.NormalMax_isNULL = false; if (inst.getProperty("NormalMin", instance.NormalMin) == OK) instance.NormalMin_isNULL = false; if (inst.getProperty("MaxReadable", instance.MaxReadable) == OK) instance.MaxReadable_isNULL = false; if (inst.getProperty("MinReadable", instance.MinReadable) == OK) instance.MinReadable_isNULL = false; if (inst.getProperty("Resolution", instance.Resolution) == OK) instance.Resolution_isNULL = false; if (inst.getProperty("Tolerance", instance.Tolerance) == OK) instance.Tolerance_isNULL = false; if (inst.getProperty("Accuracy", instance.Accuracy) == OK) instance.Accuracy_isNULL = false; if (inst.getProperty("IsLinear", instance.IsLinear) == OK) instance.IsLinear_isNULL = false; if (inst.getProperty("Hysteresis", instance.Hysteresis) == OK) instance.Hysteresis_isNULL = false; if (inst.getProperty("LowerThresholdNonCritical", instance.LowerThresholdNonCritical) == OK) instance.LowerThresholdNonCritical_isNULL = false; if (inst.getProperty("UpperThresholdNonCritical", instance.UpperThresholdNonCritical) == OK) instance.UpperThresholdNonCritical_isNULL = false; if (inst.getProperty("LowerThresholdCritical", instance.LowerThresholdCritical) == OK) instance.LowerThresholdCritical_isNULL = false; if (inst.getProperty("UpperThresholdCritical", instance.UpperThresholdCritical) == OK) instance.UpperThresholdCritical_isNULL = false; if (inst.getProperty("LowerThresholdFatal", instance.LowerThresholdFatal) == OK) instance.LowerThresholdFatal_isNULL = false; if (inst.getProperty("UpperThresholdFatal", instance.UpperThresholdFatal) == OK) instance.UpperThresholdFatal_isNULL = false; if (inst.getProperty("SupportedThresholds", instance.SupportedThresholds) == OK) instance.SupportedThresholds_isNULL = false; if (inst.getProperty("EnabledThresholds", instance.EnabledThresholds) == OK) instance.EnabledThresholds_isNULL = false; if (inst.getProperty("SettableThresholds", instance.SettableThresholds) == OK) instance.SettableThresholds_isNULL = false; _L_; } void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_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 Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_ProcessorVoltageSensor_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 Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_In& args) { _E_; CMPIStatus rc; CMPIData data; int SensorReading; data = in->ft->getArg(in, "SensorReading", &rc); if (rc.rc == OK) { CT_ToC(data, SensorReading); args.setSensorReading(SensorReading); } int Accuracy; data = in->ft->getArg(in, "Accuracy", &rc); if (rc.rc == OK) { CT_ToC(data, Accuracy); args.setAccuracy(Accuracy); } unsigned int Resolution; data = in->ft->getArg(in, "Resolution", &rc); if (rc.rc == OK) { CT_ToC(data, Resolution); args.setResolution(Resolution); } int Tolerance; data = in->ft->getArg(in, "Tolerance", &rc); if (rc.rc == OK) { CT_ToC(data, Tolerance); args.setTolerance(Tolerance); } unsigned int Hysteresis; data = in->ft->getArg(in, "Hysteresis", &rc); if (rc.rc == OK) { CT_ToC(data, Hysteresis); args.setHysteresis(Hysteresis); } _L_; } void Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_Out& args) { _E_; CMPIValue value; int errorMessage; int Accuracy; errorMessage = args.getAccuracy(Accuracy); if (errorMessage == OK) { value = CT_toCMPI(Accuracy); out->ft->addArg(out, "Accuracy", &value, CMPI_sint32); } unsigned int Resolution; errorMessage = args.getResolution(Resolution); if (errorMessage == OK) { value = CT_toCMPI(Resolution); out->ft->addArg(out, "Resolution", &value, CMPI_uint32); } int Tolerance; errorMessage = args.getTolerance(Tolerance); if (errorMessage == OK) { value = CT_toCMPI(Tolerance); out->ft->addArg(out, "Tolerance", &value, CMPI_sint32); } unsigned int Hysteresis; errorMessage = args.getHysteresis(Hysteresis); if (errorMessage == OK) { value = CT_toCMPI(Hysteresis); out->ft->addArg(out, "Hysteresis", &value, CMPI_uint32); } _L_; } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/OpenDRIM_ProcessorVoltageSensorAccess.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/OpenDRIM_ProcessorVoltageSensorAccess0000644000175000017500000002323311401065455034567 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ProcessorVoltageSensorAccess.h" const string systemCreationClassName="OpenDRIM_ComputerSystem"; const string creationClassName="OpenDRIM_ProcessorVoltageSensor"; string systemName; vector<_processor_topology> cpu_info_processors_information; vector<_processor_information> SMBIOS_processors_information; int Sensors_OpenDRIM_ProcessorVoltageSensor_load(const CMPIBroker* broker, string& errorMessage) { _E_; // get info from cpuinfo CF_assert(CPU_getProcessors("/proc/cpuinfo", cpu_info_processors_information, errorMessage)); // get info from SMBIOS SMBIOS_getProcessorsInformation(SMBIOS_processors_information, errorMessage); // different processors count... if (cpu_info_processors_information.size() != SMBIOS_processors_information.size()) { errorMessage="CPU count error"; return ERROR; } CF_assert(CF_getSystemName(systemName, errorMessage)); _L_; return OK; } int Sensors_OpenDRIM_ProcessorVoltageSensor_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_ProcessorVoltageSensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; for (unsigned int i = 0; i < SMBIOS_processors_information.size(); i++) { OpenDRIM_ProcessorVoltageSensor instance; instance.setSystemName(systemName); instance.setSystemCreationClassName(systemCreationClassName); instance.setCreationClassName(creationClassName); instance.setDeviceID(CF_intToStr(i)); if (SMBIOS_processors_information[i].has_voltage) { if (discriminant == "ei") CF_assert(Sensors_OpenDRIM_ProcessorVoltageSensor_populate(instance, i, errorMessage)); result.push_back(instance); } } _L_; return OK; } int Sensors_OpenDRIM_ProcessorVoltageSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ProcessorVoltageSensor& instance, const char** properties, string& errorMessage) { _E_; int deviceID=atoi(instance.DeviceID.c_str()); if(instance.SystemName != systemName || instance.SystemCreationClassName != systemCreationClassName || instance.CreationClassName != creationClassName || !CF_isNumber(instance.DeviceID) || deviceID >= SMBIOS_processors_information.size() || deviceID < 0) { errorMessage="No instance"; return NOT_FOUND; } CF_assert(Sensors_OpenDRIM_ProcessorVoltageSensor_populate(instance, deviceID, errorMessage)); _L_; return OK; } int Sensors_OpenDRIM_ProcessorVoltageSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& newInstance, const OpenDRIM_ProcessorVoltageSensor& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_RequestStateChange_In& in, OpenDRIM_ProcessorVoltageSensor_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_SetPowerState_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_EnableDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_OnlineDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_QuiesceDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_RestoreDefaultThresholds(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ProcessorVoltageSensor& instance, unsigned int& returnValue, const OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_In& in, OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ProcessorVoltageSensor_populate(OpenDRIM_ProcessorVoltageSensor& instance, int num, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] SystemCreationClassName * [X] SystemName * [X] CreationClassName * [X] DeviceID * [X] BaseUnits * [X] UnitModifier * [X] RateUnits * [X] CurrentReading * [\] SupportedThresholds => cannot fill it * [\] SettableThresholds => cannot fill it * [X] SensorType * [X] PossibleStates * [\] CurrentState * [X] ElementName * [X] EnabledState * [X] RequestedState * [X] OperationalStatus * [X] HealthState */ vector OperationalStatus; vector power; char cmd[256]; // we don't support RequestedStateChange() instance.setRequestedState(12); // default instance.setEnabledState(5); // Not Applicable OperationalStatus.push_back(0); // unknown instance.setOperationalStatus(OperationalStatus); instance.setHealthState(0); // unknown instance.setSensorType(3); // Voltage instance.setUnitModifier(-3); instance.setRateUnits(0); // none instance.setBaseUnits(5); // Volts // set info from SMBIOS instance.setCurrentReading(SMBIOS_processors_information[num].voltage); // set info from /proc/cpuinfo instance.setElementName(cpu_info_processors_information[num].name + " Voltage sensor"); sprintf(cmd,"cat /proc/acpi/processor/CPU%d/power",0); CF_assert(CF_runCommandToLines(cmd,power,0,errorMessage)); // FIXME: Need to be improved for(unsigned int i=0;i element; if(power[i].find("active state")==0) { CF_splitText(element,power[i]," "); instance.setCurrentState(element[2]); } else if(power[i].find("max_cstate")==0) { vector states; CF_splitText(element,power[i]," "); unsigned int max=atoi(&(element[1].c_str()[1])); for(unsigned int j=0;j<=max;j++) states.push_back("C"+CF_intToStr(j)); instance.setPossibleStates(states); } } _L_; return OK; } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/cmpiOpenDRIM_ProcessorVoltageSensor.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/cmpiOpenDRIM_ProcessorVoltageSensor.h0000644000175000017500000000675111401065455034552 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_PROCESSORVOLTAGESENSOR_H_ #define CMPIOPENDRIM_PROCESSORVOLTAGESENSOR_H_ #include "OpenDRIM_ProcessorVoltageSensor.h" CMPIObjectPath* Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ProcessorVoltageSensor& instance); CMPIInstance* Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ProcessorVoltageSensor& instance); void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ProcessorVoltageSensor& instance); void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ProcessorVoltageSensor& instance); void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_RequestStateChange_In& args); void Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_ProcessorVoltageSensor_RequestStateChange_Out& args); void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_SetPowerState_In& args); void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_EnableDevice_In& args); void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_OnlineDevice_In& args); void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_QuiesceDevice_In& args); void Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_In& args); void Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_Out& args); #endif /*CMPIOPENDRIM_PROCESSORVOLTAGESENSOR_H_*/ ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/OpenDRIM_ProcessorVoltageSensorProvider.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ProcessorVoltageSensor/OpenDRIM_ProcessorVoltageSensorProvid0000644000175000017500000004663411401065455034643 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorVoltageSensor.h" #include "OpenDRIM_ProcessorVoltageSensorAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_ProcessorVoltageSensorProviderSetInstance Sensors_OpenDRIM_ProcessorVoltageSensorProviderModifyInstance #endif int Sensors_OpenDRIM_ProcessorVoltageSensor_init(const CMPIBroker* broker); int Sensors_OpenDRIM_ProcessorVoltageSensor_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_ProcessorVoltageSensorProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ProcessorVoltageSensorProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ProcessorVoltageSensorProviderEnumInstances(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 = Sensors_OpenDRIM_ProcessorVoltageSensor_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ProcessorVoltageSensorProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorVoltageSensor instance; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ProcessorVoltageSensorProviderSetInstance(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_ProcessorVoltageSensor newInstance, oldInstance; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ProcessorVoltageSensorProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorVoltageSensor instance; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ProcessorVoltageSensorProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ProcessorVoltageSensor instance; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ProcessorVoltageSensorProviderExecQuery(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 Sensors_OpenDRIM_ProcessorVoltageSensorProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ProcessorVoltageSensorProviderInvokeMethod(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_ProcessorVoltageSensor instance; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_ProcessorVoltageSensor_RequestStateChange_In inArgs; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, in, inArgs); OpenDRIM_ProcessorVoltageSensor_RequestStateChange_Out outArgs; errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_ProcessorVoltageSensor_SetPowerState_In inArgs; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_ProcessorVoltageSensor_EnableDevice_In inArgs; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_ProcessorVoltageSensor_OnlineDevice_In inArgs; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_ProcessorVoltageSensor_QuiesceDevice_In inArgs; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_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 =="RestoreDefaultThresholds") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_RestoreDefaultThresholds(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_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 =="GetNonLinearFactors") { unsigned int returnValue; OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_In inArgs; Sensors_OpenDRIM_ProcessorVoltageSensor_toCPP(_broker, in, inArgs); OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors_Out outArgs; errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_GetNonLinearFactors(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } Sensors_OpenDRIM_ProcessorVoltageSensor_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_ProcessorVoltageSensor_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 Sensors_OpenDRIM_ProcessorVoltageSensor_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_ProcessorVoltageSensor_init FAILED: " + (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_ProcessorVoltageSensor_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_ProcessorVoltageSensor_unload FAILED: " + (string) OpenDRIM_ProcessorVoltageSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_ProcessorVoltageSensor_INIT if (Sensors_OpenDRIM_ProcessorVoltageSensor_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_ProcessorVoltageSensorProvider, Sensors_OpenDRIM_ProcessorVoltageSensorProvider, _broker, Sensors_OpenDRIM_ProcessorVoltageSensor_INIT); CMMethodMIStub(Sensors_OpenDRIM_ProcessorVoltageSensorProvider, Sensors_OpenDRIM_ProcessorVoltageSensorProvider, _broker, Sensors_OpenDRIM_ProcessorVoltageSensor_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_NumericSensor/0000755000175000017500000000000011401065455023470 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_NumericSensor/cmpiOpenDRIM_NumericSensor.cpp0000644000175000017500000005254011401065455031304 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_NumericSensor.h" CMPIObjectPath* Sensors_OpenDRIM_NumericSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_NumericSensor& instance) { _E_; Objectpath op(broker, OpenDRIM_NumericSensor_classnames[0], OpenDRIM_NumericSensor_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_NumericSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_NumericSensor& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_NumericSensor_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.SensorType_isNULL) ci.setProperty("SensorType", instance.SensorType); if (!instance.OtherSensorTypeDescription_isNULL) ci.setProperty("OtherSensorTypeDescription", instance.OtherSensorTypeDescription); if (!instance.PossibleStates_isNULL) ci.setProperty("PossibleStates", instance.PossibleStates); if (!instance.CurrentState_isNULL) ci.setProperty("CurrentState", instance.CurrentState); if (!instance.PollingInterval_isNULL) ci.setProperty("PollingInterval", instance.PollingInterval); if (!instance.BaseUnits_isNULL) ci.setProperty("BaseUnits", instance.BaseUnits); if (!instance.UnitModifier_isNULL) ci.setProperty("UnitModifier", instance.UnitModifier); if (!instance.RateUnits_isNULL) ci.setProperty("RateUnits", instance.RateUnits); if (!instance.CurrentReading_isNULL) ci.setProperty("CurrentReading", instance.CurrentReading); if (!instance.NominalReading_isNULL) ci.setProperty("NominalReading", instance.NominalReading); if (!instance.NormalMax_isNULL) ci.setProperty("NormalMax", instance.NormalMax); if (!instance.NormalMin_isNULL) ci.setProperty("NormalMin", instance.NormalMin); if (!instance.MaxReadable_isNULL) ci.setProperty("MaxReadable", instance.MaxReadable); if (!instance.MinReadable_isNULL) ci.setProperty("MinReadable", instance.MinReadable); if (!instance.Resolution_isNULL) ci.setProperty("Resolution", instance.Resolution); if (!instance.Tolerance_isNULL) ci.setProperty("Tolerance", instance.Tolerance); if (!instance.Accuracy_isNULL) ci.setProperty("Accuracy", instance.Accuracy); if (!instance.IsLinear_isNULL) ci.setProperty("IsLinear", instance.IsLinear); if (!instance.Hysteresis_isNULL) ci.setProperty("Hysteresis", instance.Hysteresis); if (!instance.LowerThresholdNonCritical_isNULL) ci.setProperty("LowerThresholdNonCritical", instance.LowerThresholdNonCritical); if (!instance.UpperThresholdNonCritical_isNULL) ci.setProperty("UpperThresholdNonCritical", instance.UpperThresholdNonCritical); if (!instance.LowerThresholdCritical_isNULL) ci.setProperty("LowerThresholdCritical", instance.LowerThresholdCritical); if (!instance.UpperThresholdCritical_isNULL) ci.setProperty("UpperThresholdCritical", instance.UpperThresholdCritical); if (!instance.LowerThresholdFatal_isNULL) ci.setProperty("LowerThresholdFatal", instance.LowerThresholdFatal); if (!instance.UpperThresholdFatal_isNULL) ci.setProperty("UpperThresholdFatal", instance.UpperThresholdFatal); if (!instance.SupportedThresholds_isNULL) ci.setProperty("SupportedThresholds", instance.SupportedThresholds); if (!instance.EnabledThresholds_isNULL) ci.setProperty("EnabledThresholds", instance.EnabledThresholds); if (!instance.SettableThresholds_isNULL) ci.setProperty("SettableThresholds", instance.SettableThresholds); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_NumericSensor& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_NumericSensor& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getProperty("SensorType", instance.SensorType) == OK) instance.SensorType_isNULL = false; if (inst.getProperty("OtherSensorTypeDescription", instance.OtherSensorTypeDescription) == OK) instance.OtherSensorTypeDescription_isNULL = false; if (inst.getProperty("PossibleStates", instance.PossibleStates) == OK) instance.PossibleStates_isNULL = false; if (inst.getProperty("CurrentState", instance.CurrentState) == OK) instance.CurrentState_isNULL = false; if (inst.getProperty("PollingInterval", instance.PollingInterval) == OK) instance.PollingInterval_isNULL = false; if (inst.getProperty("BaseUnits", instance.BaseUnits) == OK) instance.BaseUnits_isNULL = false; if (inst.getProperty("UnitModifier", instance.UnitModifier) == OK) instance.UnitModifier_isNULL = false; if (inst.getProperty("RateUnits", instance.RateUnits) == OK) instance.RateUnits_isNULL = false; if (inst.getProperty("CurrentReading", instance.CurrentReading) == OK) instance.CurrentReading_isNULL = false; if (inst.getProperty("NominalReading", instance.NominalReading) == OK) instance.NominalReading_isNULL = false; if (inst.getProperty("NormalMax", instance.NormalMax) == OK) instance.NormalMax_isNULL = false; if (inst.getProperty("NormalMin", instance.NormalMin) == OK) instance.NormalMin_isNULL = false; if (inst.getProperty("MaxReadable", instance.MaxReadable) == OK) instance.MaxReadable_isNULL = false; if (inst.getProperty("MinReadable", instance.MinReadable) == OK) instance.MinReadable_isNULL = false; if (inst.getProperty("Resolution", instance.Resolution) == OK) instance.Resolution_isNULL = false; if (inst.getProperty("Tolerance", instance.Tolerance) == OK) instance.Tolerance_isNULL = false; if (inst.getProperty("Accuracy", instance.Accuracy) == OK) instance.Accuracy_isNULL = false; if (inst.getProperty("IsLinear", instance.IsLinear) == OK) instance.IsLinear_isNULL = false; if (inst.getProperty("Hysteresis", instance.Hysteresis) == OK) instance.Hysteresis_isNULL = false; if (inst.getProperty("LowerThresholdNonCritical", instance.LowerThresholdNonCritical) == OK) instance.LowerThresholdNonCritical_isNULL = false; if (inst.getProperty("UpperThresholdNonCritical", instance.UpperThresholdNonCritical) == OK) instance.UpperThresholdNonCritical_isNULL = false; if (inst.getProperty("LowerThresholdCritical", instance.LowerThresholdCritical) == OK) instance.LowerThresholdCritical_isNULL = false; if (inst.getProperty("UpperThresholdCritical", instance.UpperThresholdCritical) == OK) instance.UpperThresholdCritical_isNULL = false; if (inst.getProperty("LowerThresholdFatal", instance.LowerThresholdFatal) == OK) instance.LowerThresholdFatal_isNULL = false; if (inst.getProperty("UpperThresholdFatal", instance.UpperThresholdFatal) == OK) instance.UpperThresholdFatal_isNULL = false; if (inst.getProperty("SupportedThresholds", instance.SupportedThresholds) == OK) instance.SupportedThresholds_isNULL = false; if (inst.getProperty("EnabledThresholds", instance.EnabledThresholds) == OK) instance.EnabledThresholds_isNULL = false; if (inst.getProperty("SettableThresholds", instance.SettableThresholds) == OK) instance.SettableThresholds_isNULL = false; _L_; } void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_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 Sensors_OpenDRIM_NumericSensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_NumericSensor_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 Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_GetNonLinearFactors_In& args) { _E_; CMPIStatus rc; CMPIData data; int SensorReading; data = in->ft->getArg(in, "SensorReading", &rc); if (rc.rc == OK) { CT_ToC(data, SensorReading); args.setSensorReading(SensorReading); } int Accuracy; data = in->ft->getArg(in, "Accuracy", &rc); if (rc.rc == OK) { CT_ToC(data, Accuracy); args.setAccuracy(Accuracy); } unsigned int Resolution; data = in->ft->getArg(in, "Resolution", &rc); if (rc.rc == OK) { CT_ToC(data, Resolution); args.setResolution(Resolution); } int Tolerance; data = in->ft->getArg(in, "Tolerance", &rc); if (rc.rc == OK) { CT_ToC(data, Tolerance); args.setTolerance(Tolerance); } unsigned int Hysteresis; data = in->ft->getArg(in, "Hysteresis", &rc); if (rc.rc == OK) { CT_ToC(data, Hysteresis); args.setHysteresis(Hysteresis); } _L_; } void Sensors_OpenDRIM_NumericSensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_NumericSensor_GetNonLinearFactors_Out& args) { _E_; CMPIValue value; int errorMessage; int Accuracy; errorMessage = args.getAccuracy(Accuracy); if (errorMessage == OK) { value = CT_toCMPI(Accuracy); out->ft->addArg(out, "Accuracy", &value, CMPI_sint32); } unsigned int Resolution; errorMessage = args.getResolution(Resolution); if (errorMessage == OK) { value = CT_toCMPI(Resolution); out->ft->addArg(out, "Resolution", &value, CMPI_uint32); } int Tolerance; errorMessage = args.getTolerance(Tolerance); if (errorMessage == OK) { value = CT_toCMPI(Tolerance); out->ft->addArg(out, "Tolerance", &value, CMPI_sint32); } unsigned int Hysteresis; errorMessage = args.getHysteresis(Hysteresis); if (errorMessage == OK) { value = CT_toCMPI(Hysteresis); out->ft->addArg(out, "Hysteresis", &value, CMPI_uint32); } _L_; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_NumericSensor/Makefile.am0000644000175000017500000000377111401065455025534 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_NumericSensorProvider.la libcmpiSensors_OpenDRIM_NumericSensorProvider_la_SOURCES = OpenDRIM_NumericSensorAccess.cpp OpenDRIM_NumericSensorProvider.cpp cmpiOpenDRIM_NumericSensor.cpp libcmpiSensors_OpenDRIM_NumericSensorProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la libcmpiSensors_OpenDRIM_NumericSensorProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_NumericSensor.h OpenDRIM_NumericSensor.h OpenDRIM_NumericSensorAccess.h opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_NumericSensor/OpenDRIM_NumericSensorAccess.h0000644000175000017500000001217511401065455031222 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_NUMERICSENSORACCESS_H_ #define OPENDRIM_NUMERICSENSORACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_NumericSensor.h" int Sensors_OpenDRIM_NumericSensor_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_unload(string& errorMessage); int Sensors_OpenDRIM_NumericSensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_NumericSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_NumericSensor& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& newInstance, const OpenDRIM_NumericSensor& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_RequestStateChange_In& in, OpenDRIM_NumericSensor_RequestStateChange_Out& out, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_SetPowerState_In& in, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_EnableDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_OnlineDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_QuiesceDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_RestoreDefaultThresholds(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_GetNonLinearFactors(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_GetNonLinearFactors_In& in, OpenDRIM_NumericSensor_GetNonLinearFactors_Out& out, string& errorMessage); int Sensors_OpenDRIM_NumericSensor_populate(OpenDRIM_NumericSensor& instance, string& errorMessage); #endif /*OPENDRIM_NUMERICSENSORACCESS_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_NumericSensor/OpenDRIM_NumericSensor.h0000644000175000017500000010302511401065455030073 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_NUMERICSENSOR_H_ #define OPENDRIM_NUMERICSENSOR_H_ #include const static char* OpenDRIM_NumericSensor_classnames[] = {"OpenDRIM_NumericSensor"}; static string OpenDRIM_NumericSensor_NAMESPACE = _NAMESPACE; class OpenDRIM_NumericSensor { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; unsigned short SensorType; bool SensorType_isNULL; string OtherSensorTypeDescription; bool OtherSensorTypeDescription_isNULL; vector PossibleStates; bool PossibleStates_isNULL; string CurrentState; bool CurrentState_isNULL; unsigned long long PollingInterval; bool PollingInterval_isNULL; unsigned short BaseUnits; bool BaseUnits_isNULL; int UnitModifier; bool UnitModifier_isNULL; unsigned short RateUnits; bool RateUnits_isNULL; int CurrentReading; bool CurrentReading_isNULL; int NominalReading; bool NominalReading_isNULL; int NormalMax; bool NormalMax_isNULL; int NormalMin; bool NormalMin_isNULL; int MaxReadable; bool MaxReadable_isNULL; int MinReadable; bool MinReadable_isNULL; unsigned int Resolution; bool Resolution_isNULL; int Tolerance; bool Tolerance_isNULL; int Accuracy; bool Accuracy_isNULL; bool IsLinear; bool IsLinear_isNULL; unsigned int Hysteresis; bool Hysteresis_isNULL; int LowerThresholdNonCritical; bool LowerThresholdNonCritical_isNULL; int UpperThresholdNonCritical; bool UpperThresholdNonCritical_isNULL; int LowerThresholdCritical; bool LowerThresholdCritical_isNULL; int UpperThresholdCritical; bool UpperThresholdCritical_isNULL; int LowerThresholdFatal; bool LowerThresholdFatal_isNULL; int UpperThresholdFatal; bool UpperThresholdFatal_isNULL; vector SupportedThresholds; bool SupportedThresholds_isNULL; vector EnabledThresholds; bool EnabledThresholds_isNULL; vector SettableThresholds; bool SettableThresholds_isNULL; OpenDRIM_NumericSensor() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; SensorType_isNULL = true; OtherSensorTypeDescription_isNULL = true; PossibleStates_isNULL = true; CurrentState_isNULL = true; PollingInterval_isNULL = true; BaseUnits_isNULL = true; UnitModifier_isNULL = true; RateUnits_isNULL = true; CurrentReading_isNULL = true; NominalReading_isNULL = true; NormalMax_isNULL = true; NormalMin_isNULL = true; MaxReadable_isNULL = true; MinReadable_isNULL = true; Resolution_isNULL = true; Tolerance_isNULL = true; Accuracy_isNULL = true; IsLinear_isNULL = true; Hysteresis_isNULL = true; LowerThresholdNonCritical_isNULL = true; UpperThresholdNonCritical_isNULL = true; LowerThresholdCritical_isNULL = true; UpperThresholdCritical_isNULL = true; LowerThresholdFatal_isNULL = true; UpperThresholdFatal_isNULL = true; SupportedThresholds_isNULL = true; EnabledThresholds_isNULL = true; SettableThresholds_isNULL = true; } ~OpenDRIM_NumericSensor() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getSensorType(unsigned short& value) const { if (SensorType_isNULL==true) return NOT_FOUND; value = SensorType; return OK; } int setSensorType(const unsigned short& newValue) { SensorType = newValue; SensorType_isNULL = false; return OK; } int getOtherSensorTypeDescription(string& value) const { if (OtherSensorTypeDescription_isNULL==true) return NOT_FOUND; value = OtherSensorTypeDescription; return OK; } int setOtherSensorTypeDescription(const string& newValue) { OtherSensorTypeDescription = newValue; OtherSensorTypeDescription_isNULL = false; return OK; } int getPossibleStates(vector& value) const { if (PossibleStates_isNULL==true) return NOT_FOUND; value = PossibleStates; return OK; } int setPossibleStates(const vector& newValue) { PossibleStates = newValue; PossibleStates_isNULL = false; return OK; } int getCurrentState(string& value) const { if (CurrentState_isNULL==true) return NOT_FOUND; value = CurrentState; return OK; } int setCurrentState(const string& newValue) { CurrentState = newValue; CurrentState_isNULL = false; return OK; } int getPollingInterval(unsigned long long& value) const { if (PollingInterval_isNULL==true) return NOT_FOUND; value = PollingInterval; return OK; } int setPollingInterval(const unsigned long long& newValue) { PollingInterval = newValue; PollingInterval_isNULL = false; return OK; } int getBaseUnits(unsigned short& value) const { if (BaseUnits_isNULL==true) return NOT_FOUND; value = BaseUnits; return OK; } int setBaseUnits(const unsigned short& newValue) { BaseUnits = newValue; BaseUnits_isNULL = false; return OK; } int getUnitModifier(int& value) const { if (UnitModifier_isNULL==true) return NOT_FOUND; value = UnitModifier; return OK; } int setUnitModifier(const int& newValue) { UnitModifier = newValue; UnitModifier_isNULL = false; return OK; } int getRateUnits(unsigned short& value) const { if (RateUnits_isNULL==true) return NOT_FOUND; value = RateUnits; return OK; } int setRateUnits(const unsigned short& newValue) { RateUnits = newValue; RateUnits_isNULL = false; return OK; } int getCurrentReading(int& value) const { if (CurrentReading_isNULL==true) return NOT_FOUND; value = CurrentReading; return OK; } int setCurrentReading(const int& newValue) { CurrentReading = newValue; CurrentReading_isNULL = false; return OK; } int getNominalReading(int& value) const { if (NominalReading_isNULL==true) return NOT_FOUND; value = NominalReading; return OK; } int setNominalReading(const int& newValue) { NominalReading = newValue; NominalReading_isNULL = false; return OK; } int getNormalMax(int& value) const { if (NormalMax_isNULL==true) return NOT_FOUND; value = NormalMax; return OK; } int setNormalMax(const int& newValue) { NormalMax = newValue; NormalMax_isNULL = false; return OK; } int getNormalMin(int& value) const { if (NormalMin_isNULL==true) return NOT_FOUND; value = NormalMin; return OK; } int setNormalMin(const int& newValue) { NormalMin = newValue; NormalMin_isNULL = false; return OK; } int getMaxReadable(int& value) const { if (MaxReadable_isNULL==true) return NOT_FOUND; value = MaxReadable; return OK; } int setMaxReadable(const int& newValue) { MaxReadable = newValue; MaxReadable_isNULL = false; return OK; } int getMinReadable(int& value) const { if (MinReadable_isNULL==true) return NOT_FOUND; value = MinReadable; return OK; } int setMinReadable(const int& newValue) { MinReadable = newValue; MinReadable_isNULL = false; return OK; } int getResolution(unsigned int& value) const { if (Resolution_isNULL==true) return NOT_FOUND; value = Resolution; return OK; } int setResolution(const unsigned int& newValue) { Resolution = newValue; Resolution_isNULL = false; return OK; } int getTolerance(int& value) const { if (Tolerance_isNULL==true) return NOT_FOUND; value = Tolerance; return OK; } int setTolerance(const int& newValue) { Tolerance = newValue; Tolerance_isNULL = false; return OK; } int getAccuracy(int& value) const { if (Accuracy_isNULL==true) return NOT_FOUND; value = Accuracy; return OK; } int setAccuracy(const int& newValue) { Accuracy = newValue; Accuracy_isNULL = false; return OK; } int getIsLinear(bool& value) const { if (IsLinear_isNULL==true) return NOT_FOUND; value = IsLinear; return OK; } int setIsLinear(const bool& newValue) { IsLinear = newValue; IsLinear_isNULL = false; return OK; } int getHysteresis(unsigned int& value) const { if (Hysteresis_isNULL==true) return NOT_FOUND; value = Hysteresis; return OK; } int setHysteresis(const unsigned int& newValue) { Hysteresis = newValue; Hysteresis_isNULL = false; return OK; } int getLowerThresholdNonCritical(int& value) const { if (LowerThresholdNonCritical_isNULL==true) return NOT_FOUND; value = LowerThresholdNonCritical; return OK; } int setLowerThresholdNonCritical(const int& newValue) { LowerThresholdNonCritical = newValue; LowerThresholdNonCritical_isNULL = false; return OK; } int getUpperThresholdNonCritical(int& value) const { if (UpperThresholdNonCritical_isNULL==true) return NOT_FOUND; value = UpperThresholdNonCritical; return OK; } int setUpperThresholdNonCritical(const int& newValue) { UpperThresholdNonCritical = newValue; UpperThresholdNonCritical_isNULL = false; return OK; } int getLowerThresholdCritical(int& value) const { if (LowerThresholdCritical_isNULL==true) return NOT_FOUND; value = LowerThresholdCritical; return OK; } int setLowerThresholdCritical(const int& newValue) { LowerThresholdCritical = newValue; LowerThresholdCritical_isNULL = false; return OK; } int getUpperThresholdCritical(int& value) const { if (UpperThresholdCritical_isNULL==true) return NOT_FOUND; value = UpperThresholdCritical; return OK; } int setUpperThresholdCritical(const int& newValue) { UpperThresholdCritical = newValue; UpperThresholdCritical_isNULL = false; return OK; } int getLowerThresholdFatal(int& value) const { if (LowerThresholdFatal_isNULL==true) return NOT_FOUND; value = LowerThresholdFatal; return OK; } int setLowerThresholdFatal(const int& newValue) { LowerThresholdFatal = newValue; LowerThresholdFatal_isNULL = false; return OK; } int getUpperThresholdFatal(int& value) const { if (UpperThresholdFatal_isNULL==true) return NOT_FOUND; value = UpperThresholdFatal; return OK; } int setUpperThresholdFatal(const int& newValue) { UpperThresholdFatal = newValue; UpperThresholdFatal_isNULL = false; return OK; } int getSupportedThresholds(vector& value) const { if (SupportedThresholds_isNULL==true) return NOT_FOUND; value = SupportedThresholds; return OK; } int setSupportedThresholds(const vector& newValue) { SupportedThresholds = newValue; SupportedThresholds_isNULL = false; return OK; } int getEnabledThresholds(vector& value) const { if (EnabledThresholds_isNULL==true) return NOT_FOUND; value = EnabledThresholds; return OK; } int setEnabledThresholds(const vector& newValue) { EnabledThresholds = newValue; EnabledThresholds_isNULL = false; return OK; } int getSettableThresholds(vector& value) const { if (SettableThresholds_isNULL==true) return NOT_FOUND; value = SettableThresholds; return OK; } int setSettableThresholds(const vector& newValue) { SettableThresholds = newValue; SettableThresholds_isNULL = false; return OK; } }; class OpenDRIM_NumericSensor_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_NumericSensor_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_NumericSensor_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_NumericSensor_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_NumericSensor_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_NumericSensor_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_NumericSensor_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_NumericSensor_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_NumericSensor_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_NumericSensor_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_NumericSensor_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_NumericSensor_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_NumericSensor_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_NumericSensor_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_NumericSensor_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_NumericSensor_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_NumericSensor_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_NumericSensor_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; class OpenDRIM_NumericSensor_GetNonLinearFactors_In { public: int SensorReading; bool SensorReading_isNULL; int Accuracy; bool Accuracy_isNULL; unsigned int Resolution; bool Resolution_isNULL; int Tolerance; bool Tolerance_isNULL; unsigned int Hysteresis; bool Hysteresis_isNULL; OpenDRIM_NumericSensor_GetNonLinearFactors_In() { SensorReading_isNULL = true; Accuracy_isNULL = true; Resolution_isNULL = true; Tolerance_isNULL = true; Hysteresis_isNULL = true; } ~OpenDRIM_NumericSensor_GetNonLinearFactors_In() {} int getSensorReading(int& value) const { if (SensorReading_isNULL == true) return NOT_FOUND; value = SensorReading; return OK; } int setSensorReading(const int& newValue) { SensorReading = newValue; SensorReading_isNULL = false; return OK; } int getAccuracy(int& value) const { if (Accuracy_isNULL == true) return NOT_FOUND; value = Accuracy; return OK; } int setAccuracy(const int& newValue) { Accuracy = newValue; Accuracy_isNULL = false; return OK; } int getResolution(unsigned int& value) const { if (Resolution_isNULL == true) return NOT_FOUND; value = Resolution; return OK; } int setResolution(const unsigned int& newValue) { Resolution = newValue; Resolution_isNULL = false; return OK; } int getTolerance(int& value) const { if (Tolerance_isNULL == true) return NOT_FOUND; value = Tolerance; return OK; } int setTolerance(const int& newValue) { Tolerance = newValue; Tolerance_isNULL = false; return OK; } int getHysteresis(unsigned int& value) const { if (Hysteresis_isNULL == true) return NOT_FOUND; value = Hysteresis; return OK; } int setHysteresis(const unsigned int& newValue) { Hysteresis = newValue; Hysteresis_isNULL = false; return OK; } }; class OpenDRIM_NumericSensor_GetNonLinearFactors_Out { public: int Accuracy; bool Accuracy_isNULL; unsigned int Resolution; bool Resolution_isNULL; int Tolerance; bool Tolerance_isNULL; unsigned int Hysteresis; bool Hysteresis_isNULL; OpenDRIM_NumericSensor_GetNonLinearFactors_Out() { Accuracy_isNULL = true; Resolution_isNULL = true; Tolerance_isNULL = true; Hysteresis_isNULL = true; } ~OpenDRIM_NumericSensor_GetNonLinearFactors_Out() {} int getAccuracy(int& value) const { if (Accuracy_isNULL == true) return NOT_FOUND; value = Accuracy; return OK; } int setAccuracy(const int& newValue) { Accuracy = newValue; Accuracy_isNULL = false; return OK; } int getResolution(unsigned int& value) const { if (Resolution_isNULL == true) return NOT_FOUND; value = Resolution; return OK; } int setResolution(const unsigned int& newValue) { Resolution = newValue; Resolution_isNULL = false; return OK; } int getTolerance(int& value) const { if (Tolerance_isNULL == true) return NOT_FOUND; value = Tolerance; return OK; } int setTolerance(const int& newValue) { Tolerance = newValue; Tolerance_isNULL = false; return OK; } int getHysteresis(unsigned int& value) const { if (Hysteresis_isNULL == true) return NOT_FOUND; value = Hysteresis; return OK; } int setHysteresis(const unsigned int& newValue) { Hysteresis = newValue; Hysteresis_isNULL = false; return OK; } }; #endif /*OPENDRIM_NUMERICSENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_NumericSensor/OpenDRIM_NumericSensorAccess.cpp0000644000175000017500000001340211401065455031547 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_NumericSensorAccess.h" int Sensors_OpenDRIM_NumericSensor_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_NumericSensor_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_NumericSensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_NumericSensor& instance, const char** properties, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& newInstance, const OpenDRIM_NumericSensor& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_RequestStateChange_In& in, OpenDRIM_NumericSensor_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_SetPowerState_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_EnableDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_OnlineDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_QuiesceDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_RestoreDefaultThresholds(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_GetNonLinearFactors(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_NumericSensor& instance, unsigned int& returnValue, const OpenDRIM_NumericSensor_GetNonLinearFactors_In& in, OpenDRIM_NumericSensor_GetNonLinearFactors_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_NumericSensor_populate(OpenDRIM_NumericSensor& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_NumericSensor/OpenDRIM_NumericSensorProvider.cpp0000644000175000017500000004467611401065455032161 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_NumericSensor.h" #include "OpenDRIM_NumericSensorAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_NumericSensorProviderSetInstance Sensors_OpenDRIM_NumericSensorProviderModifyInstance #endif int Sensors_OpenDRIM_NumericSensor_init(const CMPIBroker* broker); int Sensors_OpenDRIM_NumericSensor_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_NumericSensorProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_NumericSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_NumericSensorProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_NumericSensor_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_NumericSensor_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_NumericSensorProviderEnumInstances(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 = Sensors_OpenDRIM_NumericSensor_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_NumericSensor_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_NumericSensorProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_NumericSensor instance; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_NumericSensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_NumericSensor_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_NumericSensorProviderSetInstance(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_NumericSensor newInstance, oldInstance; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_NumericSensor_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_NumericSensor_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_NumericSensor_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_NumericSensorProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_NumericSensor instance; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_NumericSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_NumericSensor_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_NumericSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_NumericSensor_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_NumericSensorProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_NumericSensor instance; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_NumericSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_NumericSensor_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_NumericSensorProviderExecQuery(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 Sensors_OpenDRIM_NumericSensorProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_NumericSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_NumericSensorProviderInvokeMethod(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_NumericSensor instance; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = Sensors_OpenDRIM_NumericSensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_NumericSensor_RequestStateChange_In inArgs; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, in, inArgs); OpenDRIM_NumericSensor_RequestStateChange_Out outArgs; errorCode = Sensors_OpenDRIM_NumericSensor_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } Sensors_OpenDRIM_NumericSensor_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_NumericSensor_SetPowerState_In inArgs; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_NumericSensor_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_NumericSensor_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_NumericSensor_EnableDevice_In inArgs; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_NumericSensor_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_NumericSensor_OnlineDevice_In inArgs; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_NumericSensor_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_NumericSensor_QuiesceDevice_In inArgs; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_NumericSensor_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_NumericSensor_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_NumericSensor_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_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 =="RestoreDefaultThresholds") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_NumericSensor_RestoreDefaultThresholds(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_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 =="GetNonLinearFactors") { unsigned int returnValue; OpenDRIM_NumericSensor_GetNonLinearFactors_In inArgs; Sensors_OpenDRIM_NumericSensor_toCPP(_broker, in, inArgs); OpenDRIM_NumericSensor_GetNonLinearFactors_Out outArgs; errorCode = Sensors_OpenDRIM_NumericSensor_GetNonLinearFactors(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } Sensors_OpenDRIM_NumericSensor_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_NumericSensor_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 Sensors_OpenDRIM_NumericSensor_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_NumericSensor_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_NumericSensor_init FAILED: " + (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_NumericSensor_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_NumericSensor_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_NumericSensor_unload FAILED: " + (string) OpenDRIM_NumericSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_NumericSensor_INIT if (Sensors_OpenDRIM_NumericSensor_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_NumericSensorProvider, Sensors_OpenDRIM_NumericSensorProvider, _broker, Sensors_OpenDRIM_NumericSensor_INIT); CMMethodMIStub(Sensors_OpenDRIM_NumericSensorProvider, Sensors_OpenDRIM_NumericSensorProvider, _broker, Sensors_OpenDRIM_NumericSensor_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_NumericSensor/cmpiOpenDRIM_NumericSensor.h0000644000175000017500000000635511401065455030754 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_NUMERICSENSOR_H_ #define CMPIOPENDRIM_NUMERICSENSOR_H_ #include "OpenDRIM_NumericSensor.h" CMPIObjectPath* Sensors_OpenDRIM_NumericSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_NumericSensor& instance); CMPIInstance* Sensors_OpenDRIM_NumericSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_NumericSensor& instance); void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_NumericSensor& instance); void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_NumericSensor& instance); void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_RequestStateChange_In& args); void Sensors_OpenDRIM_NumericSensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_NumericSensor_RequestStateChange_Out& args); void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_SetPowerState_In& args); void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_EnableDevice_In& args); void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_OnlineDevice_In& args); void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_QuiesceDevice_In& args); void Sensors_OpenDRIM_NumericSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_NumericSensor_GetNonLinearFactors_In& args); void Sensors_OpenDRIM_NumericSensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_NumericSensor_GetNonLinearFactors_Out& args); #endif /*CMPIOPENDRIM_NUMERICSENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/0000755000175000017500000000000011401065455025500 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/OpenDRIM_SensorConformsToProfile.h0000644000175000017500000000722611401065455034121 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_SENSORCONFORMSTOPROFILE_H_ #define OPENDRIM_SENSORCONFORMSTOPROFILE_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_SensorConformsToProfile_classnames[] = {"OpenDRIM_SensorConformsToProfile"}; static string OpenDRIM_SensorConformsToProfile_NAMESPACE = _INTEROP_NAMESPACE; const static string ConformantStandard_role = "ConformantStandard"; const static char* ConformantStandard_classnames[] = {"OpenDRIM_RegisteredSensorProfile"}; const static string ConformantStandard_NAMESPACE = _INTEROP_NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"CIM_Sensor"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_SensorConformsToProfile { public: Objectpath ConformantStandard; bool ConformantStandard_isNULL; Objectpath ManagedElement; bool ManagedElement_isNULL; OpenDRIM_SensorConformsToProfile() { ConformantStandard_isNULL = true; ManagedElement_isNULL = true; } ~OpenDRIM_SensorConformsToProfile() {} 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_SENSORCONFORMSTOPROFILE_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/Makefile.am0000644000175000017500000000500111401065455027530 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_SensorConformsToProfileProvider.la libcmpiSensors_OpenDRIM_SensorConformsToProfileProvider_la_SOURCES = OpenDRIM_SensorConformsToProfileAccess.cpp OpenDRIM_SensorConformsToProfileProvider.cpp cmpiOpenDRIM_SensorConformsToProfile.cpp assocOpenDRIM_SensorConformsToProfile.cpp # May have to be adjusted for direct invocation libcmpiSensors_OpenDRIM_SensorConformsToProfileProvider_la_CPPFLAGS = -I../CIM_RegisteredProfile -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiSensors_OpenDRIM_SensorConformsToProfileProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la #../CIM_RegisteredProfile/libcmpiSensors_CIM_RegisteredProfileProvider.la ../CIM_ManagedElement/libcmpiSensors_CIM_ManagedElementProvider.la libcmpiSensors_OpenDRIM_SensorConformsToProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SensorConformsToProfile.h OpenDRIM_SensorConformsToProfile.h OpenDRIM_SensorConformsToProfileAccess.h ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/assocOpenDRIM_SensorConformsToProfile.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/assocOpenDRIM_SensorConformsToProfil0000644000175000017500000002142111401065455034550 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_SensorConformsToProfile.h" int Sensors_OpenDRIM_SensorConformsToProfile_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 = Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_OpenDRIM_SensorConformsToProfile_associatorManagedElementToConformantStandard(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_RegisteredProfile_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_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; Sensors_CIM_RegisteredProfile_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_RegisteredProfile_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_RegisteredProfile_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_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; Sensors_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/OpenDRIM_SensorConformsToProfileAccess.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/OpenDRIM_SensorConformsToProfileAcce0000644000175000017500000002576011401065455034452 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_SensorConformsToProfileAccess.h" int Sensors_OpenDRIM_SensorConformsToProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_RegisteredProfile_load(broker, errorMessage)); CF_assert(Sensors_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_RegisteredProfile_unload(errorMessage)); CF_assert(Sensors_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_isAssociated(const Instance& ConformantStandard, const Instance& ManagedElement, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string sensor_creationClassName; CF_assert(ManagedElement.getProperty("CreationClassName", sensor_creationClassName)); if (sensor_creationClassName.find_first_of("OpenDRIM_")==0) isAssociated=true; else isAssociated=false; _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_OpenDRIM_SensorConformsToProfile_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; Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_OpenDRIM_SensorConformsToProfile_referenceConformantStandardToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SensorConformsToProfile& 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(Sensors_OpenDRIM_SensorConformsToProfile_getConformantStandard(broker, ctx, ConformantStandard_objectpath, ConformantStandard_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(Sensors_OpenDRIM_SensorConformsToProfile_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(Sensors_OpenDRIM_SensorConformsToProfile_isAssociated(ConformantStandard_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorConformsToProfile& newInstance, const OpenDRIM_SensorConformsToProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_SensorConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_SensorConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_OpenDRIM_SensorConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_OpenDRIM_SensorConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_SensorConformsToProfile_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(Sensors_OpenDRIM_SensorConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_SensorConformsToProfile_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_SensorConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); OpenDRIM_SensorConformsToProfile_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_SensorConformsToProfile_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_SensorConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); OpenDRIM_SensorConformsToProfile_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_populate(OpenDRIM_SensorConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/cmpiOpenDRIM_SensorConformsToProfile.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/cmpiOpenDRIM_SensorConformsToProfile0000644000175000017500000000630411401065455034540 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_SensorConformsToProfile.h" CMPIObjectPath* Sensors_OpenDRIM_SensorConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SensorConformsToProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_SensorConformsToProfile_classnames[0], OpenDRIM_SensorConformsToProfile_NAMESPACE); if (!instance.ConformantStandard_isNULL) op.addKey("ConformantStandard", instance.ConformantStandard); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_SensorConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SensorConformsToProfile& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_SensorConformsToProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_SensorConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SensorConformsToProfile& 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 Sensors_OpenDRIM_SensorConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SensorConformsToProfile& 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_; } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/assocOpenDRIM_SensorConformsToProfile.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/assocOpenDRIM_SensorConformsToProfil0000644000175000017500000000626311401065455034557 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_SENSORCONFORMSTOPROFILE_H_ #define ASSOCOPENDRIM_SENSORCONFORMSTOPROFILE_H_ #include "OpenDRIM_SensorConformsToProfileAccess.h" int Sensors_OpenDRIM_SensorConformsToProfile_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 Sensors_OpenDRIM_SensorConformsToProfile_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 Sensors_OpenDRIM_SensorConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_SensorConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_SensorConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_SensorConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_SENSORCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/OpenDRIM_SensorConformsToProfileAccess.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/OpenDRIM_SensorConformsToProfileAcce0000644000175000017500000001073711401065455034450 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_SENSORCONFORMSTOPROFILEACCESS_H_ #define OPENDRIM_SENSORCONFORMSTOPROFILEACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_SensorConformsToProfile.h" #include "assocOpenDRIM_SensorConformsToProfile.h" int Sensors_OpenDRIM_SensorConformsToProfile_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_SensorConformsToProfile_unload(string& errorMessage); int Sensors_OpenDRIM_SensorConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_SensorConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SensorConformsToProfile& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_SensorConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorConformsToProfile& newInstance, const OpenDRIM_SensorConformsToProfile& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_SensorConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorConformsToProfile& instance, string& errorMessage); int Sensors_OpenDRIM_SensorConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorConformsToProfile& instance, string& errorMessage); int Sensors_OpenDRIM_SensorConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_SensorConformsToProfile_associatorManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_SensorConformsToProfile_referenceConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const vector& ManagedElement_instances, vector& OpenDRIM_SensorConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_SensorConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_SensorConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_SensorConformsToProfile_populate(OpenDRIM_SensorConformsToProfile& instance, string& errorMessage); #endif /*OPENDRIM_SENSORCONFORMSTOPROFILEACCESS_H_*/ ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/OpenDRIM_SensorConformsToProfileProvider.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/OpenDRIM_SensorConformsToProfileProv0000644000175000017500000004261211401065455034540 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_SensorConformsToProfile.h" #include "OpenDRIM_SensorConformsToProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_SensorConformsToProfileProviderSetInstance Sensors_OpenDRIM_SensorConformsToProfileProviderModifyInstance #endif int Sensors_OpenDRIM_SensorConformsToProfile_init(const CMPIBroker* broker); int Sensors_OpenDRIM_SensorConformsToProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_SensorConformsToProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_SensorConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorConformsToProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_SensorConformsToProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_SensorConformsToProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorConformsToProfileProviderEnumInstances(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 = Sensors_OpenDRIM_SensorConformsToProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_SensorConformsToProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorConformsToProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SensorConformsToProfile instance; Sensors_OpenDRIM_SensorConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_SensorConformsToProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_SensorConformsToProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorConformsToProfileProviderSetInstance(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_SensorConformsToProfile newInstance, oldInstance; Sensors_OpenDRIM_SensorConformsToProfile_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_SensorConformsToProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_SensorConformsToProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_SensorConformsToProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorConformsToProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SensorConformsToProfile instance; Sensors_OpenDRIM_SensorConformsToProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_SensorConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_SensorConformsToProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_SensorConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_SensorConformsToProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorConformsToProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SensorConformsToProfile instance; Sensors_OpenDRIM_SensorConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_SensorConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_SensorConformsToProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorConformsToProfileProviderExecQuery(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 Sensors_OpenDRIM_SensorConformsToProfileProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_SensorConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorConformsToProfileProviderAssociatorNames(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 = Sensors_OpenDRIM_SensorConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_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 Sensors_OpenDRIM_SensorConformsToProfileProviderAssociators(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 = Sensors_OpenDRIM_SensorConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_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 Sensors_OpenDRIM_SensorConformsToProfileProviderReferenceNames(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 = Sensors_OpenDRIM_SensorConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_SensorConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = Sensors_OpenDRIM_SensorConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_SensorConformsToProfile_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorConformsToProfileProviderReferences(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 = Sensors_OpenDRIM_SensorConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_SensorConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = Sensors_OpenDRIM_SensorConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = Sensors_OpenDRIM_SensorConformsToProfile_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int Sensors_OpenDRIM_SensorConformsToProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_SensorConformsToProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_SensorConformsToProfile_init FAILED: " + (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_SensorConformsToProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_SensorConformsToProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_SensorConformsToProfile_unload FAILED: " + (string) OpenDRIM_SensorConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_SensorConformsToProfile_INIT if (Sensors_OpenDRIM_SensorConformsToProfile_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_SensorConformsToProfileProvider, Sensors_OpenDRIM_SensorConformsToProfileProvider, _broker, Sensors_OpenDRIM_SensorConformsToProfile_INIT); CMAssociationMIStub(Sensors_OpenDRIM_SensorConformsToProfileProvider, Sensors_OpenDRIM_SensorConformsToProfileProvider, _broker, Sensors_OpenDRIM_SensorConformsToProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/cmpiOpenDRIM_SensorConformsToProfile.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorConformsToProfile/cmpiOpenDRIM_SensorConformsToProfile0000644000175000017500000000437511401065455034546 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_SENSORCONFORMSTOPROFILE_H_ #define CMPIOPENDRIM_SENSORCONFORMSTOPROFILE_H_ #include "OpenDRIM_SensorConformsToProfile.h" CMPIObjectPath* Sensors_OpenDRIM_SensorConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SensorConformsToProfile& instance); CMPIInstance* Sensors_OpenDRIM_SensorConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SensorConformsToProfile& instance); void Sensors_OpenDRIM_SensorConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SensorConformsToProfile& instance); void Sensors_OpenDRIM_SensorConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SensorConformsToProfile& instance); #endif /*CMPIOPENDRIM_SENSORCONFORMSTOPROFILE_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorCapabilities/0000755000175000017500000000000011401065455024457 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorCapabilities/OpenDRIM_SensorCapabilities.h0000644000175000017500000000760311401065455032056 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_SENSORCAPABILITIES_H_ #define OPENDRIM_SENSORCAPABILITIES_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_SensorCapabilities_classnames[] = {"OpenDRIM_SensorCapabilities"}; static string OpenDRIM_SensorCapabilities_NAMESPACE = _NAMESPACE; const static string Capabilities_role = "Capabilities"; const static char* Capabilities_classnames[] = {"CIM_Capabilities"}; const static string Capabilities_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"CIM_ManagedElement"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_SensorCapabilities { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath Capabilities; bool Capabilities_isNULL; vector Characteristics; bool Characteristics_isNULL; OpenDRIM_SensorCapabilities() { ManagedElement_isNULL = true; Capabilities_isNULL = true; Characteristics_isNULL = true; } ~OpenDRIM_SensorCapabilities() {} 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_SENSORCAPABILITIES_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorCapabilities/Makefile.am0000644000175000017500000000466611401065455026527 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_SensorCapabilitiesProvider.la libcmpiSensors_OpenDRIM_SensorCapabilitiesProvider_la_SOURCES = OpenDRIM_SensorCapabilitiesAccess.cpp OpenDRIM_SensorCapabilitiesProvider.cpp cmpiOpenDRIM_SensorCapabilities.cpp assocOpenDRIM_SensorCapabilities.cpp # May have to be adjusted for direct invocation libcmpiSensors_OpenDRIM_SensorCapabilitiesProvider_la_CPPFLAGS = -I../CIM_Capabilities -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiSensors_OpenDRIM_SensorCapabilitiesProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la #../CIM_Capabilities/libcmpiSensors_CIM_CapabilitiesProvider.la ../CIM_ManagedElement/libcmpiSensors_CIM_ManagedElementProvider.la libcmpiSensors_OpenDRIM_SensorCapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SensorCapabilities.h OpenDRIM_SensorCapabilities.h OpenDRIM_SensorCapabilitiesAccess.h opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorCapabilities/cmpiOpenDRIM_SensorCapabilities.h0000644000175000017500000000430111401065455032717 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_SENSORCAPABILITIES_H_ #define CMPIOPENDRIM_SENSORCAPABILITIES_H_ #include "OpenDRIM_SensorCapabilities.h" CMPIObjectPath* Sensors_OpenDRIM_SensorCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SensorCapabilities& instance); CMPIInstance* Sensors_OpenDRIM_SensorCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SensorCapabilities& instance); void Sensors_OpenDRIM_SensorCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SensorCapabilities& instance); void Sensors_OpenDRIM_SensorCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SensorCapabilities& instance); #endif /*CMPIOPENDRIM_SENSORCAPABILITIES_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorCapabilities/assocOpenDRIM_SensorCapabilities.h0000644000175000017500000000616511401065455033111 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_SENSORCAPABILITIES_H_ #define ASSOCOPENDRIM_SENSORCAPABILITIES_H_ #include "OpenDRIM_SensorCapabilitiesAccess.h" int Sensors_OpenDRIM_SensorCapabilities_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 Sensors_OpenDRIM_SensorCapabilities_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 Sensors_OpenDRIM_SensorCapabilities_enumerateCapabilitiess(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_SensorCapabilities_getCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_SensorCapabilities_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_SensorCapabilities_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_SENSORCAPABILITIES_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorCapabilities/OpenDRIM_SensorCapabilitiesProvider.cpp0000644000175000017500000004166011401065455034125 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_SensorCapabilities.h" #include "OpenDRIM_SensorCapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_SensorCapabilitiesProviderSetInstance Sensors_OpenDRIM_SensorCapabilitiesProviderModifyInstance #endif int Sensors_OpenDRIM_SensorCapabilities_init(const CMPIBroker* broker); int Sensors_OpenDRIM_SensorCapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_SensorCapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_SensorCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorCapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_SensorCapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_SensorCapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorCapabilitiesProviderEnumInstances(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 = Sensors_OpenDRIM_SensorCapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_SensorCapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorCapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SensorCapabilities instance; Sensors_OpenDRIM_SensorCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_SensorCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_SensorCapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorCapabilitiesProviderSetInstance(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_SensorCapabilities newInstance, oldInstance; Sensors_OpenDRIM_SensorCapabilities_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_SensorCapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_SensorCapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_SensorCapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorCapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SensorCapabilities instance; Sensors_OpenDRIM_SensorCapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_SensorCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_SensorCapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_SensorCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_SensorCapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorCapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SensorCapabilities instance; Sensors_OpenDRIM_SensorCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_SensorCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_SensorCapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorCapabilitiesProviderExecQuery(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 Sensors_OpenDRIM_SensorCapabilitiesProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_SensorCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorCapabilitiesProviderAssociatorNames(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 = Sensors_OpenDRIM_SensorCapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_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 Sensors_OpenDRIM_SensorCapabilitiesProviderAssociators(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 = Sensors_OpenDRIM_SensorCapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_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 Sensors_OpenDRIM_SensorCapabilitiesProviderReferenceNames(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 = Sensors_OpenDRIM_SensorCapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_SensorCapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = Sensors_OpenDRIM_SensorCapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_SensorCapabilities_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorCapabilitiesProviderReferences(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 = Sensors_OpenDRIM_SensorCapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_SensorCapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = Sensors_OpenDRIM_SensorCapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = Sensors_OpenDRIM_SensorCapabilities_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int Sensors_OpenDRIM_SensorCapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_SensorCapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_SensorCapabilities_init FAILED: " + (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_SensorCapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_SensorCapabilities_unload FAILED: " + (string) OpenDRIM_SensorCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_SensorCapabilities_INIT if (Sensors_OpenDRIM_SensorCapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_SensorCapabilitiesProvider, Sensors_OpenDRIM_SensorCapabilitiesProvider, _broker, Sensors_OpenDRIM_SensorCapabilities_INIT); CMAssociationMIStub(Sensors_OpenDRIM_SensorCapabilitiesProvider, Sensors_OpenDRIM_SensorCapabilitiesProvider, _broker, Sensors_OpenDRIM_SensorCapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorCapabilities/OpenDRIM_SensorCapabilitiesAccess.h0000644000175000017500000001044311401065455033174 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_SENSORCAPABILITIESACCESS_H_ #define OPENDRIM_SENSORCAPABILITIESACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_SensorCapabilities.h" #include "assocOpenDRIM_SensorCapabilities.h" int Sensors_OpenDRIM_SensorCapabilities_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_SensorCapabilities_unload(string& errorMessage); int Sensors_OpenDRIM_SensorCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_SensorCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SensorCapabilities& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_SensorCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorCapabilities& newInstance, const OpenDRIM_SensorCapabilities& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_SensorCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorCapabilities& instance, string& errorMessage); int Sensors_OpenDRIM_SensorCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorCapabilities& instance, string& errorMessage); int Sensors_OpenDRIM_SensorCapabilities_associatorCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_SensorCapabilities_associatorManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& Capabilities_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_SensorCapabilities_referenceCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const vector& ManagedElement_instances, vector& OpenDRIM_SensorCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_SensorCapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_SensorCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_SensorCapabilities_populate(OpenDRIM_SensorCapabilities& instance, string& errorMessage); #endif /*OPENDRIM_SENSORCAPABILITIESACCESS_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorCapabilities/OpenDRIM_SensorCapabilitiesAccess.cpp0000644000175000017500000002522311401065455033531 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_SensorCapabilitiesAccess.h" int Sensors_OpenDRIM_SensorCapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_Capabilities_load(broker, errorMessage)); CF_assert(Sensors_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_Capabilities_unload(errorMessage)); CF_assert(Sensors_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_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 Sensors_OpenDRIM_SensorCapabilities_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(Sensors_OpenDRIM_SensorCapabilities_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(Sensors_OpenDRIM_SensorCapabilities_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; Sensors_OpenDRIM_SensorCapabilities_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(Sensors_OpenDRIM_SensorCapabilities_referenceCapabilitiesToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SensorCapabilities& 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(Sensors_OpenDRIM_SensorCapabilities_getCapabilities(broker, ctx, Capabilities_objectpath, Capabilities_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(Sensors_OpenDRIM_SensorCapabilities_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(Sensors_OpenDRIM_SensorCapabilities_isAssociated(Capabilities_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(Sensors_OpenDRIM_SensorCapabilities_populate(instance, errorMessage)); _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorCapabilities& newInstance, const OpenDRIM_SensorCapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_SensorCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_SensorCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SensorCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_SensorCapabilities_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(Sensors_OpenDRIM_SensorCapabilities_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_SensorCapabilities_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(Sensors_OpenDRIM_SensorCapabilities_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(Sensors_OpenDRIM_SensorCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_SensorCapabilities_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(Sensors_OpenDRIM_SensorCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_SensorCapabilities_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_SensorCapabilities instance; instance.setCapabilities(((Instance) Capabilities_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(Sensors_OpenDRIM_SensorCapabilities_populate(instance, errorMessage)); } OpenDRIM_SensorCapabilities_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_SensorCapabilities_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_SensorCapabilities instance; instance.setCapabilities(((Instance) Capabilities_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(Sensors_OpenDRIM_SensorCapabilities_populate(instance, errorMessage)); } OpenDRIM_SensorCapabilities_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_populate(OpenDRIM_SensorCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorCapabilities/assocOpenDRIM_SensorCapabilities.cpp0000644000175000017500000002107111401065455033435 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_SensorCapabilities.h" int Sensors_OpenDRIM_SensorCapabilities_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 = Sensors_OpenDRIM_SensorCapabilities_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(Sensors_OpenDRIM_SensorCapabilities_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(Sensors_OpenDRIM_SensorCapabilities_associatorManagedElementToCapabilities(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_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(Sensors_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_Capabilities_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_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; Sensors_CIM_Capabilities_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_Capabilities_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_Capabilities_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_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(Sensors_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_SensorCapabilities_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; Sensors_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_SensorCapabilities/cmpiOpenDRIM_SensorCapabilities.cpp0000644000175000017500000000645711401065455033270 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_SensorCapabilities.h" CMPIObjectPath* Sensors_OpenDRIM_SensorCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SensorCapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_SensorCapabilities_classnames[0], OpenDRIM_SensorCapabilities_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.Capabilities_isNULL) op.addKey("Capabilities", instance.Capabilities); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_SensorCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SensorCapabilities& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_SensorCapabilities_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Characteristics_isNULL) ci.setProperty("Characteristics", instance.Characteristics); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_SensorCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SensorCapabilities& 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 Sensors_OpenDRIM_SensorCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SensorCapabilities& 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-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/0000755000175000017500000000000011401065455025551 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/Makefile.am0000644000175000017500000000413511401065455027610 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_BatteryTempratureSensorProvider.la libcmpiSensors_OpenDRIM_BatteryTempratureSensorProvider_la_SOURCES = OpenDRIM_BatteryTempratureSensorAccess.cpp OpenDRIM_BatteryTempratureSensorProvider.cpp cmpiOpenDRIM_BatteryTempratureSensor.cpp libcmpiSensors_OpenDRIM_BatteryTempratureSensorProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la libcmpiSensors_OpenDRIM_BatteryTempratureSensorProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_BatteryTempratureSensor.h OpenDRIM_BatteryTempratureSensor.h OpenDRIM_BatteryTempratureSensorAccess.h ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/OpenDRIM_BatteryTempratureSensorAccess.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/OpenDRIM_BatteryTempratureSensorAcce0000644000175000017500000001203411401065455034562 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_BATTERYTEMPRATURESENSORACCESS_H_ #define OPENDRIM_BATTERYTEMPRATURESENSORACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_BatteryTempratureSensor.h" int Sensors_OpenDRIM_BatteryTempratureSensor_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_unload(string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_BatteryTempratureSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_BatteryTempratureSensor& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& newInstance, const OpenDRIM_BatteryTempratureSensor& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, const OpenDRIM_BatteryTempratureSensor_RequestStateChange_In& in, OpenDRIM_BatteryTempratureSensor_RequestStateChange_Out& out, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, const OpenDRIM_BatteryTempratureSensor_SetPowerState_In& in, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, const OpenDRIM_BatteryTempratureSensor_EnableDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, const OpenDRIM_BatteryTempratureSensor_OnlineDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, const OpenDRIM_BatteryTempratureSensor_QuiesceDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_BatteryTempratureSensor_populate(OpenDRIM_BatteryTempratureSensor& instance, string& errorMessage); #endif /*OPENDRIM_BATTERYTEMPRATURESENSORACCESS_H_*/ ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/cmpiOpenDRIM_BatteryTempratureSensor.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/cmpiOpenDRIM_BatteryTempratureSensor0000644000175000017500000003550611401065455034670 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BatteryTempratureSensor.h" CMPIObjectPath* Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_BatteryTempratureSensor& instance) { _E_; Objectpath op(broker, OpenDRIM_BatteryTempratureSensor_classnames[0], OpenDRIM_BatteryTempratureSensor_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_BatteryTempratureSensor& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.SensorType_isNULL) ci.setProperty("SensorType", instance.SensorType); if (!instance.OtherSensorTypeDescription_isNULL) ci.setProperty("OtherSensorTypeDescription", instance.OtherSensorTypeDescription); if (!instance.PossibleStates_isNULL) ci.setProperty("PossibleStates", instance.PossibleStates); if (!instance.CurrentState_isNULL) ci.setProperty("CurrentState", instance.CurrentState); if (!instance.PollingInterval_isNULL) ci.setProperty("PollingInterval", instance.PollingInterval); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_BatteryTempratureSensor& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_BatteryTempratureSensor& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getProperty("SensorType", instance.SensorType) == OK) instance.SensorType_isNULL = false; if (inst.getProperty("OtherSensorTypeDescription", instance.OtherSensorTypeDescription) == OK) instance.OtherSensorTypeDescription_isNULL = false; if (inst.getProperty("PossibleStates", instance.PossibleStates) == OK) instance.PossibleStates_isNULL = false; if (inst.getProperty("CurrentState", instance.CurrentState) == OK) instance.CurrentState_isNULL = false; if (inst.getProperty("PollingInterval", instance.PollingInterval) == OK) instance.PollingInterval_isNULL = false; _L_; } void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_BatteryTempratureSensor_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 Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_BatteryTempratureSensor_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 Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_BatteryTempratureSensor_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_BatteryTempratureSensor_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_BatteryTempratureSensor_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_BatteryTempratureSensor_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/OpenDRIM_BatteryTempratureSensorAccess.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/OpenDRIM_BatteryTempratureSensorAcce0000644000175000017500000001304511401065455034565 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_BatteryTempratureSensorAccess.h" int Sensors_OpenDRIM_BatteryTempratureSensor_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_BatteryTempratureSensor_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_BatteryTempratureSensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_BatteryTempratureSensor& instance, const char** properties, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& newInstance, const OpenDRIM_BatteryTempratureSensor& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, const OpenDRIM_BatteryTempratureSensor_RequestStateChange_In& in, OpenDRIM_BatteryTempratureSensor_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, const OpenDRIM_BatteryTempratureSensor_SetPowerState_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, const OpenDRIM_BatteryTempratureSensor_EnableDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, const OpenDRIM_BatteryTempratureSensor_OnlineDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, const OpenDRIM_BatteryTempratureSensor_QuiesceDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryTempratureSensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_BatteryTempratureSensor_populate(OpenDRIM_BatteryTempratureSensor& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/OpenDRIM_BatteryTempratureSensor.h0000644000175000017500000005451411401065455034245 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_BATTERYTEMPRATURESENSOR_H_ #define OPENDRIM_BATTERYTEMPRATURESENSOR_H_ #include const static char* OpenDRIM_BatteryTempratureSensor_classnames[] = {"OpenDRIM_BatteryTempratureSensor"}; static string OpenDRIM_BatteryTempratureSensor_NAMESPACE = _NAMESPACE; class OpenDRIM_BatteryTempratureSensor { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; unsigned short SensorType; bool SensorType_isNULL; string OtherSensorTypeDescription; bool OtherSensorTypeDescription_isNULL; vector PossibleStates; bool PossibleStates_isNULL; string CurrentState; bool CurrentState_isNULL; unsigned long long PollingInterval; bool PollingInterval_isNULL; OpenDRIM_BatteryTempratureSensor() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; SensorType_isNULL = true; OtherSensorTypeDescription_isNULL = true; PossibleStates_isNULL = true; CurrentState_isNULL = true; PollingInterval_isNULL = true; } ~OpenDRIM_BatteryTempratureSensor() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getSensorType(unsigned short& value) const { if (SensorType_isNULL==true) return NOT_FOUND; value = SensorType; return OK; } int setSensorType(const unsigned short& newValue) { SensorType = newValue; SensorType_isNULL = false; return OK; } int getOtherSensorTypeDescription(string& value) const { if (OtherSensorTypeDescription_isNULL==true) return NOT_FOUND; value = OtherSensorTypeDescription; return OK; } int setOtherSensorTypeDescription(const string& newValue) { OtherSensorTypeDescription = newValue; OtherSensorTypeDescription_isNULL = false; return OK; } int getPossibleStates(vector& value) const { if (PossibleStates_isNULL==true) return NOT_FOUND; value = PossibleStates; return OK; } int setPossibleStates(const vector& newValue) { PossibleStates = newValue; PossibleStates_isNULL = false; return OK; } int getCurrentState(string& value) const { if (CurrentState_isNULL==true) return NOT_FOUND; value = CurrentState; return OK; } int setCurrentState(const string& newValue) { CurrentState = newValue; CurrentState_isNULL = false; return OK; } int getPollingInterval(unsigned long long& value) const { if (PollingInterval_isNULL==true) return NOT_FOUND; value = PollingInterval; return OK; } int setPollingInterval(const unsigned long long& newValue) { PollingInterval = newValue; PollingInterval_isNULL = false; return OK; } }; class OpenDRIM_BatteryTempratureSensor_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_BatteryTempratureSensor_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_BatteryTempratureSensor_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_BatteryTempratureSensor_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_BatteryTempratureSensor_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_BatteryTempratureSensor_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_BatteryTempratureSensor_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_BatteryTempratureSensor_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_BatteryTempratureSensor_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_BatteryTempratureSensor_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_BatteryTempratureSensor_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_BatteryTempratureSensor_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_BatteryTempratureSensor_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_BatteryTempratureSensor_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_BatteryTempratureSensor_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_BatteryTempratureSensor_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_BatteryTempratureSensor_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_BatteryTempratureSensor_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; #endif /*OPENDRIM_BATTERYTEMPRATURESENSOR_H_*/ ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/OpenDRIM_BatteryTempratureSensorProvider.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/OpenDRIM_BatteryTempratureSensorProv0000644000175000017500000004424511401065455034666 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BatteryTempratureSensor.h" #include "OpenDRIM_BatteryTempratureSensorAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_BatteryTempratureSensorProviderSetInstance Sensors_OpenDRIM_BatteryTempratureSensorProviderModifyInstance #endif int Sensors_OpenDRIM_BatteryTempratureSensor_init(const CMPIBroker* broker); int Sensors_OpenDRIM_BatteryTempratureSensor_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_BatteryTempratureSensorProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_BatteryTempratureSensorProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_BatteryTempratureSensorProviderEnumInstances(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 = Sensors_OpenDRIM_BatteryTempratureSensor_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_BatteryTempratureSensorProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BatteryTempratureSensor instance; Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_BatteryTempratureSensorProviderSetInstance(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_BatteryTempratureSensor newInstance, oldInstance; Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_BatteryTempratureSensorProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BatteryTempratureSensor instance; Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_BatteryTempratureSensorProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BatteryTempratureSensor instance; Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_BatteryTempratureSensorProviderExecQuery(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 Sensors_OpenDRIM_BatteryTempratureSensorProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_BatteryTempratureSensorProviderInvokeMethod(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_BatteryTempratureSensor instance; Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_BatteryTempratureSensor_RequestStateChange_In inArgs; Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, in, inArgs); OpenDRIM_BatteryTempratureSensor_RequestStateChange_Out outArgs; errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_BatteryTempratureSensor_SetPowerState_In inArgs; Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_BatteryTempratureSensor_EnableDevice_In inArgs; Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_BatteryTempratureSensor_OnlineDevice_In inArgs; Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_BatteryTempratureSensor_QuiesceDevice_In inArgs; Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryTempratureSensor_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_BatteryTempratureSensor_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 Sensors_OpenDRIM_BatteryTempratureSensor_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_BatteryTempratureSensor_init FAILED: " + (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_BatteryTempratureSensor_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_BatteryTempratureSensor_unload FAILED: " + (string) OpenDRIM_BatteryTempratureSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_BatteryTempratureSensor_INIT if (Sensors_OpenDRIM_BatteryTempratureSensor_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_BatteryTempratureSensorProvider, Sensors_OpenDRIM_BatteryTempratureSensorProvider, _broker, Sensors_OpenDRIM_BatteryTempratureSensor_INIT); CMMethodMIStub(Sensors_OpenDRIM_BatteryTempratureSensorProvider, Sensors_OpenDRIM_BatteryTempratureSensorProvider, _broker, Sensors_OpenDRIM_BatteryTempratureSensor_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/cmpiOpenDRIM_BatteryTempratureSensor.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_BatteryTempratureSensor/cmpiOpenDRIM_BatteryTempratureSensor0000644000175000017500000000627111401065455034665 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_BATTERYTEMPRATURESENSOR_H_ #define CMPIOPENDRIM_BATTERYTEMPRATURESENSOR_H_ #include "OpenDRIM_BatteryTempratureSensor.h" CMPIObjectPath* Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_BatteryTempratureSensor& instance); CMPIInstance* Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_BatteryTempratureSensor& instance); void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_BatteryTempratureSensor& instance); void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_BatteryTempratureSensor& instance); void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_BatteryTempratureSensor_RequestStateChange_In& args); void Sensors_OpenDRIM_BatteryTempratureSensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_BatteryTempratureSensor_RequestStateChange_Out& args); void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_BatteryTempratureSensor_SetPowerState_In& args); void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_BatteryTempratureSensor_EnableDevice_In& args); void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_BatteryTempratureSensor_OnlineDevice_In& args); void Sensors_OpenDRIM_BatteryTempratureSensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_BatteryTempratureSensor_QuiesceDevice_In& args); #endif /*CMPIOPENDRIM_BATTERYTEMPRATURESENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/Makefile.am0000644000175000017500000001111111401065455021266 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ VENDOR = OpenDRIM VERSION = $(shell cat ./VERSION) APP_NAME = opendrim-lmp-sensors RPM_PACKAGE_DIR = packaging PLATFORM = $(shell rpm --eval %_target_cpu) WORKING_DIR = $(shell pwd) SUBDIRS = Common OpenDRIM_BatteryTempratureSensor OpenDRIM_Sensor OpenDRIM_RegisteredSensorsProfile OpenDRIM_ProcessorVoltageSensor OpenDRIM_NumericSensor OpenDRIM_EnabledSensorCapabilities OpenDRIM_AssociatedProcessorVoltageSensor OpenDRIM_SensorConformsToProfile OpenDRIM_SensorCapabilities OpenDRIM_ComputerSystemSensor OpenDRIM_AssociatedBatterySensor OpenDRIM_AssociatedSensor test postinstall: registration/Sensors.sh @CIMNAMESPACE@ $(VENDOR) @CIMSERVER@ @INTEROPNAMESPACE@ $(VERSION) . preuninstall: registration/Sensors-remove.sh @CIMNAMESPACE@ @CIMSERVER@ @INTEROPNAMESPACE@ . test-OpenDRIM_AssociatedProcessorVoltageSensor: all make -C test test-OpenDRIM_AssociatedProcessorVoltageSensor test-OpenDRIM_SensorConformsToProfile: all make -C test test-OpenDRIM_SensorConformsToProfile test-OpenDRIM_SensorCapabilities: all make -C test test-OpenDRIM_SensorCapabilities test-OpenDRIM_BatteryTempratureSensor: all make -C test test-OpenDRIM_BatteryTempratureSensor test-OpenDRIM_ComputerSystemSensor: all make -C test test-OpenDRIM_ComputerSystemSensor test-OpenDRIM_Sensor: all make -C test test-OpenDRIM_Sensor test-OpenDRIM_RegisteredSensorsProfile: all make -C test test-OpenDRIM_RegisteredSensorsProfile test-OpenDRIM_ProcessorVoltageSensor: all make -C test test-OpenDRIM_ProcessorVoltageSensor test-OpenDRIM_AssociatedBatterySensor: all make -C test test-OpenDRIM_AssociatedBatterySensor test-OpenDRIM_NumericSensor: all make -C test test-OpenDRIM_NumericSensor test-OpenDRIM_AssociatedSensor: all make -C test test-OpenDRIM_AssociatedSensor test-OpenDRIM_EnabledSensorCapabilities: all make -C test test-OpenDRIM_EnabledSensorCapabilities 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-sensors-1.0.0~ppa/registration/0000755000175000017500000000000011401065455021751 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_NumericSensor-remove.sh0000755000175000017500000000620711401065455030041 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_NumericSensorModule cimprovider -r -m Sensors_OpenDRIM_NumericSensorModule 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_NumericSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_RegisteredSensorsProfile-remove.sh0000755000175000017500000000635611401065455032245 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_RegisteredSensorsProfileModule cimprovider -r -m Sensors_OpenDRIM_RegisteredSensorsProfileModule 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_RegisteredSensorsProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_AssociatedSensor.sh0000755000175000017500000000631711401065455027225 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_AssociatedSensor.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_AssociatedSensor provider module"; Name = "Sensors_OpenDRIM_AssociatedSensorModule"; Location = "cmpiSensors_OpenDRIM_AssociatedSensorProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_AssociatedSensor provider"; Name = "Sensors_OpenDRIM_AssociatedSensorProvider"; ProviderModuleName = "Sensors_OpenDRIM_AssociatedSensorModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_AssociatedSensor provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_AssociatedSensorModule"; ProviderName = "Sensors_OpenDRIM_AssociatedSensorProvider"; ClassName = "OpenDRIM_AssociatedSensor"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "Sensors_OpenDRIM_AssociatedSensor"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_AssociatedSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_EnabledSensorCapabilities.sh0000755000175000017500000000674711401065455031021 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_EnabledSensorCapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_EnabledSensorCapabilities provider module"; Name = "Sensors_OpenDRIM_EnabledSensorCapabilitiesModule"; Location = "cmpiSensors_OpenDRIM_EnabledSensorCapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_EnabledSensorCapabilities provider"; Name = "Sensors_OpenDRIM_EnabledSensorCapabilitiesProvider"; ProviderModuleName = "Sensors_OpenDRIM_EnabledSensorCapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_EnabledSensorCapabilities provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_EnabledSensorCapabilitiesModule"; ProviderName = "Sensors_OpenDRIM_EnabledSensorCapabilitiesProvider"; ClassName = "OpenDRIM_EnabledSensorCapabilities"; ProviderType = {2}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "InstanceID", "ElementName", "ElementNameEditSupported", "MaxElementNameLen", "RequestedStatesSupported", "ElementNameMask"}; CapabilityID = "Sensors_OpenDRIM_EnabledSensorCapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_EnabledSensorCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_SensorCapabilities.sh0000755000175000017500000000641711401065455027540 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SensorCapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SensorCapabilities provider module"; Name = "Sensors_OpenDRIM_SensorCapabilitiesModule"; Location = "cmpiSensors_OpenDRIM_SensorCapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SensorCapabilities provider"; Name = "Sensors_OpenDRIM_SensorCapabilitiesProvider"; ProviderModuleName = "Sensors_OpenDRIM_SensorCapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SensorCapabilities provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_SensorCapabilitiesModule"; ProviderName = "Sensors_OpenDRIM_SensorCapabilitiesProvider"; ClassName = "OpenDRIM_SensorCapabilities"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "Capabilities", "Characteristics"}; CapabilityID = "Sensors_OpenDRIM_SensorCapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SensorCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_Sensor-remove.sh0000755000175000017500000000610111401065455026507 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_SensorModule cimprovider -r -m Sensors_OpenDRIM_SensorModule 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_Sensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/Sensors.sh0000755000175000017500000000524411401065455023751 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then if !( ps -C cimserver > /dev/null 2>&1 ) then echo "ERROR: Pegasus CIM server is not running" exit 1 fi fi if test "$3" = openwbem then if !( ps -C owcimomd > /dev/null 2>&1 ) then echo "ERROR: OpenWBEM CIM server is not running" exit 1 fi fi if test "$3" = sfcb then /etc/init.d/sfcb stop fi $6/registration/OpenDRIM_AssociatedProcessorVoltageSensor.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SensorConformsToProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SensorCapabilities.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_BatteryTempratureSensor.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ComputerSystemSensor.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_Sensor.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_RegisteredSensorsProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ProcessorVoltageSensor.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_AssociatedBatterySensor.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_NumericSensor.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_AssociatedSensor.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_EnabledSensorCapabilities.sh $1 $2 $3 $4 $5 $6 if test "$3" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_NumericSensor.sh0000755000175000017500000001103511401065455026541 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_NumericSensor.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_NumericSensor provider module"; Name = "Sensors_OpenDRIM_NumericSensorModule"; Location = "cmpiSensors_OpenDRIM_NumericSensorProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_NumericSensor provider"; Name = "Sensors_OpenDRIM_NumericSensorProvider"; ProviderModuleName = "Sensors_OpenDRIM_NumericSensorModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_NumericSensor provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_NumericSensorModule"; ProviderName = "Sensors_OpenDRIM_NumericSensorProvider"; ClassName = "OpenDRIM_NumericSensor"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "SensorType", "OtherSensorTypeDescription", "PossibleStates", "CurrentState", "PollingInterval", "BaseUnits", "UnitModifier", "RateUnits", "CurrentReading", "NominalReading", "NormalMax", "NormalMin", "MaxReadable", "MinReadable", "Resolution", "Tolerance", "Accuracy", "IsLinear", "Hysteresis", "LowerThresholdNonCritical", "UpperThresholdNonCritical", "LowerThresholdCritical", "UpperThresholdCritical", "LowerThresholdFatal", "UpperThresholdFatal", "SupportedThresholds", "EnabledThresholds", "SettableThresholds"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties", "RestoreDefaultThresholds", "GetNonLinearFactors"}; CapabilityID = "Sensors_OpenDRIM_NumericSensor"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_NumericSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_SensorCapabilities-remove.sh0000755000175000017500000000627611401065455031036 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_SensorCapabilitiesModule cimprovider -r -m Sensors_OpenDRIM_SensorCapabilitiesModule 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_SensorCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_ProcessorVoltageSensor-remove.sh0000755000175000017500000000634111401065455031737 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_ProcessorVoltageSensorModule cimprovider -r -m Sensors_OpenDRIM_ProcessorVoltageSensorModule 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_ProcessorVoltageSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_RegisteredSensorsProfile.sh0000755000175000017500000000700311401065455030740 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $4 $6/mof/OpenDRIM_RegisteredSensorsProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_RegisteredSensorsProfile provider module"; Name = "Sensors_OpenDRIM_RegisteredSensorsProfileModule"; Location = "cmpiSensors_OpenDRIM_RegisteredSensorsProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_RegisteredSensorsProfile provider"; Name = "Sensors_OpenDRIM_RegisteredSensorsProfileProvider"; ProviderModuleName = "Sensors_OpenDRIM_RegisteredSensorsProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_RegisteredSensorsProfile provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_RegisteredSensorsProfileModule"; ProviderName = "Sensors_OpenDRIM_RegisteredSensorsProfileProvider"; ClassName = "OpenDRIM_RegisteredSensorsProfile"; ProviderType = {2}; Namespaces = {"$4"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstanceID", "RegisteredOrganization", "OtherRegisteredOrganization", "RegisteredName", "RegisteredVersion", "AdvertiseTypes", "AdvertiseTypeDescriptions"}; CapabilityID = "Sensors_OpenDRIM_RegisteredSensorsProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_RegisteredSensorsProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_AssociatedSensor-remove.sh0000755000175000017500000000625211401065455030516 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_AssociatedSensorModule cimprovider -r -m Sensors_OpenDRIM_AssociatedSensorModule 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_AssociatedSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_EnabledSensorCapabilities-remove.sh0000755000175000017500000000637011401065455032304 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_EnabledSensorCapabilitiesModule cimprovider -r -m Sensors_OpenDRIM_EnabledSensorCapabilitiesModule 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_EnabledSensorCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_BatteryTempratureSensor-remove.sh0000755000175000017500000000635311401065455032124 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_BatteryTempratureSensorModule cimprovider -r -m Sensors_OpenDRIM_BatteryTempratureSensorModule 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_BatteryTempratureSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_SensorConformsToProfile.sh0000755000175000017500000000703111401065455030552 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SensorConformsToProfile.mof cimmof -aE -n $4 $6/mof/OpenDRIM_SensorConformsToProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SensorConformsToProfile provider module"; Name = "Sensors_OpenDRIM_SensorConformsToProfileModule"; Location = "cmpiSensors_OpenDRIM_SensorConformsToProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SensorConformsToProfile provider"; Name = "Sensors_OpenDRIM_SensorConformsToProfileProvider"; ProviderModuleName = "Sensors_OpenDRIM_SensorConformsToProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SensorConformsToProfile provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_SensorConformsToProfileModule"; ProviderName = "Sensors_OpenDRIM_SensorConformsToProfileProvider"; ClassName = "OpenDRIM_SensorConformsToProfile"; ProviderType = {2, 3}; Namespaces = {"$1", "$4"}; SupportedProperties = {"ConformantStandard", "ManagedElement"}; CapabilityID = "Sensors_OpenDRIM_SensorConformsToProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SensorConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_Sensor.sh0000755000175000017500000000770011401065455025222 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_Sensor.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_Sensor provider module"; Name = "Sensors_OpenDRIM_SensorModule"; Location = "cmpiSensors_OpenDRIM_SensorProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_Sensor provider"; Name = "Sensors_OpenDRIM_SensorProvider"; ProviderModuleName = "Sensors_OpenDRIM_SensorModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_Sensor provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_SensorModule"; ProviderName = "Sensors_OpenDRIM_SensorProvider"; ClassName = "OpenDRIM_Sensor"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "SensorType", "OtherSensorTypeDescription", "PossibleStates", "CurrentState", "PollingInterval"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties"}; CapabilityID = "Sensors_OpenDRIM_Sensor"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_Sensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_AssociatedBatterySensor-remove.sh0000755000175000017500000000636011401065455032051 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_AssociatedBatterySensorModule cimprovider -r -m Sensors_OpenDRIM_AssociatedBatterySensorModule 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_AssociatedBatterySensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_AssociatedProcessorVoltageSensor.sh0000755000175000017500000000677711401065455032461 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_AssociatedProcessorVoltageSensor.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_AssociatedProcessorVoltageSensor provider module"; Name = "Sensors_OpenDRIM_AssociatedProcessorVoltageSensorModule"; Location = "cmpiSensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_AssociatedProcessorVoltageSensor provider"; Name = "Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider"; ProviderModuleName = "Sensors_OpenDRIM_AssociatedProcessorVoltageSensorModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_AssociatedProcessorVoltageSensor provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_AssociatedProcessorVoltageSensorModule"; ProviderName = "Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider"; ClassName = "OpenDRIM_AssociatedProcessorVoltageSensor"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "Sensors_OpenDRIM_AssociatedProcessorVoltageSensor"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_AssociatedProcessorVoltageSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_AssociatedProcessorVoltageSensor-remove.sh0000755000175000017500000000651211401065455033737 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_AssociatedProcessorVoltageSensorModule cimprovider -r -m Sensors_OpenDRIM_AssociatedProcessorVoltageSensorModule 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_AssociatedProcessorVoltageSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/Sensors-remove.sh0000755000175000017500000000526011401065455025242 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then if !( ps -C cimserver > /dev/null 2>&1 ) then echo "ERROR: Pegasus CIM server is not running" exit 1 fi fi if test "$2" = openwbem then if !( ps -C owcimomd > /dev/null 2>&1 ) then echo "ERROR: OpenWBEM CIM server is not running" exit 1 fi fi if test "$2" = sfcb then /etc/init.d/sfcb stop fi $4/registration/OpenDRIM_EnabledSensorCapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_AssociatedSensor-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_NumericSensor-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_AssociatedBatterySensor-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_ProcessorVoltageSensor-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_RegisteredSensorsProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_Sensor-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_ComputerSystemSensor-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_BatteryTempratureSensor-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SensorCapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SensorConformsToProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_AssociatedProcessorVoltageSensor-remove.sh $1 $2 $3 $4 if test "$2" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_SensorConformsToProfile-remove.sh0000755000175000017500000001027411401065455032050 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_SensorConformsToProfileModule cimprovider -r -m Sensors_OpenDRIM_SensorConformsToProfileModule 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_SensorConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_AssociatedBatterySensor.sh0000755000175000017500000000652411401065455030560 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_AssociatedBatterySensor.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_AssociatedBatterySensor provider module"; Name = "Sensors_OpenDRIM_AssociatedBatterySensorModule"; Location = "cmpiSensors_OpenDRIM_AssociatedBatterySensorProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_AssociatedBatterySensor provider"; Name = "Sensors_OpenDRIM_AssociatedBatterySensorProvider"; ProviderModuleName = "Sensors_OpenDRIM_AssociatedBatterySensorModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_AssociatedBatterySensor provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_AssociatedBatterySensorModule"; ProviderName = "Sensors_OpenDRIM_AssociatedBatterySensorProvider"; ClassName = "OpenDRIM_AssociatedBatterySensor"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "Sensors_OpenDRIM_AssociatedBatterySensor"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_AssociatedBatterySensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_ComputerSystemSensor-remove.sh0000755000175000017500000000632211401065455031440 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$2" = pegasus then cimprovider -d -m Sensors_OpenDRIM_ComputerSystemSensorModule cimprovider -r -m Sensors_OpenDRIM_ComputerSystemSensorModule 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_ComputerSystemSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_ProcessorVoltageSensor.sh0000755000175000017500000001131011401065455030434 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ProcessorVoltageSensor.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ProcessorVoltageSensor provider module"; Name = "Sensors_OpenDRIM_ProcessorVoltageSensorModule"; Location = "cmpiSensors_OpenDRIM_ProcessorVoltageSensorProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ProcessorVoltageSensor provider"; Name = "Sensors_OpenDRIM_ProcessorVoltageSensorProvider"; ProviderModuleName = "Sensors_OpenDRIM_ProcessorVoltageSensorModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ProcessorVoltageSensor provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_ProcessorVoltageSensorModule"; ProviderName = "Sensors_OpenDRIM_ProcessorVoltageSensorProvider"; ClassName = "OpenDRIM_ProcessorVoltageSensor"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "SensorType", "OtherSensorTypeDescription", "PossibleStates", "CurrentState", "PollingInterval", "BaseUnits", "UnitModifier", "RateUnits", "CurrentReading", "NominalReading", "NormalMax", "NormalMin", "MaxReadable", "MinReadable", "Resolution", "Tolerance", "Accuracy", "IsLinear", "Hysteresis", "LowerThresholdNonCritical", "UpperThresholdNonCritical", "LowerThresholdCritical", "UpperThresholdCritical", "LowerThresholdFatal", "UpperThresholdFatal", "SupportedThresholds", "EnabledThresholds", "SettableThresholds"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties", "RestoreDefaultThresholds", "GetNonLinearFactors"}; CapabilityID = "Sensors_OpenDRIM_ProcessorVoltageSensor"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ProcessorVoltageSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_ComputerSystemSensor.sh0000755000175000017500000000644311401065455030151 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ComputerSystemSensor.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ComputerSystemSensor provider module"; Name = "Sensors_OpenDRIM_ComputerSystemSensorModule"; Location = "cmpiSensors_OpenDRIM_ComputerSystemSensorProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ComputerSystemSensor provider"; Name = "Sensors_OpenDRIM_ComputerSystemSensorProvider"; ProviderModuleName = "Sensors_OpenDRIM_ComputerSystemSensorModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ComputerSystemSensor provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_ComputerSystemSensorModule"; ProviderName = "Sensors_OpenDRIM_ComputerSystemSensorProvider"; ClassName = "OpenDRIM_ComputerSystemSensor"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"GroupComponent", "PartComponent"}; CapabilityID = "Sensors_OpenDRIM_ComputerSystemSensor"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ComputerSystemSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/registration/OpenDRIM_BatteryTempratureSensor.sh0000755000175000017500000001040311401065455030620 0ustar guillaumeguillaume#!/bin/bash ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_BatteryTempratureSensor.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_BatteryTempratureSensor provider module"; Name = "Sensors_OpenDRIM_BatteryTempratureSensorModule"; Location = "cmpiSensors_OpenDRIM_BatteryTempratureSensorProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_BatteryTempratureSensor provider"; Name = "Sensors_OpenDRIM_BatteryTempratureSensorProvider"; ProviderModuleName = "Sensors_OpenDRIM_BatteryTempratureSensorModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_BatteryTempratureSensor provider capabilities"; ProviderModuleName = "Sensors_OpenDRIM_BatteryTempratureSensorModule"; ProviderName = "Sensors_OpenDRIM_BatteryTempratureSensorProvider"; ClassName = "OpenDRIM_BatteryTempratureSensor"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "SensorType", "OtherSensorTypeDescription", "PossibleStates", "CurrentState", "PollingInterval"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties"}; CapabilityID = "Sensors_OpenDRIM_BatteryTempratureSensor"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_BatteryTempratureSensor.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/0000755000175000017500000000000011401065455025071 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/OpenDRIM_ComputerSystemSensor.h0000644000175000017500000000704211401065455033077 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_COMPUTERSYSTEMSENSOR_H_ #define OPENDRIM_COMPUTERSYSTEMSENSOR_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_LogicalDevice.h" #include "CIM_LogicalDeviceAccess.h" #include "cmpiCIM_System.h" #include "CIM_SystemAccess.h" */ const static char* OpenDRIM_ComputerSystemSensor_classnames[] = {"OpenDRIM_ComputerSystemSensor"}; static string OpenDRIM_ComputerSystemSensor_NAMESPACE = _NAMESPACE; const static string PartComponent_role = "PartComponent"; const static char* PartComponent_classnames[] = {"CIM_Sensor"}; // "OpenDRIM_Sensor, OpenDRIM_NumericSensor" const static string PartComponent_NAMESPACE = _NAMESPACE; const static string GroupComponent_role = "GroupComponent"; const static char* GroupComponent_classnames[] = {"OpenDRIM_ComputerSystem"}; const static string GroupComponent_NAMESPACE = _NAMESPACE; class OpenDRIM_ComputerSystemSensor { public: Objectpath GroupComponent; bool GroupComponent_isNULL; Objectpath PartComponent; bool PartComponent_isNULL; OpenDRIM_ComputerSystemSensor() { GroupComponent_isNULL = true; PartComponent_isNULL = true; } ~OpenDRIM_ComputerSystemSensor() {} string getKeys() const { return CF_toLowCase(".GroupComponent=\"" + CF_quoteString(GroupComponent.toString()) + "\""".PartComponent=\"" + CF_quoteString(PartComponent.toString()) + "\""); } int getGroupComponent(Objectpath& value) const { if (GroupComponent_isNULL==true) return NOT_FOUND; value = GroupComponent; return OK; } int setGroupComponent(const Objectpath& newValue) { GroupComponent = newValue; GroupComponent.setNamespace(GroupComponent_NAMESPACE); GroupComponent_isNULL = false; return OK; } int getPartComponent(Objectpath& value) const { if (PartComponent_isNULL==true) return NOT_FOUND; value = PartComponent; return OK; } int setPartComponent(const Objectpath& newValue) { PartComponent = newValue; PartComponent.setNamespace(PartComponent_NAMESPACE); PartComponent_isNULL = false; return OK; } }; #endif /*OPENDRIM_COMPUTERSYSTEMSENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/cmpiOpenDRIM_ComputerSystemSensor.cpp0000644000175000017500000000616311401065455034306 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemSensor.h" CMPIObjectPath* Sensors_OpenDRIM_ComputerSystemSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ComputerSystemSensor& instance) { _E_; Objectpath op(broker, OpenDRIM_ComputerSystemSensor_classnames[0], OpenDRIM_ComputerSystemSensor_NAMESPACE); if (!instance.GroupComponent_isNULL) op.addKey("GroupComponent", instance.GroupComponent); if (!instance.PartComponent_isNULL) op.addKey("PartComponent", instance.PartComponent); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_ComputerSystemSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ComputerSystemSensor& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_ComputerSystemSensor_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_ComputerSystemSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ComputerSystemSensor& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; if (op.getKey("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; _L_; } void Sensors_OpenDRIM_ComputerSystemSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ComputerSystemSensor& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; if (inst.getProperty("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; _L_; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/Makefile.am0000644000175000017500000000467111401065455027135 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_ComputerSystemSensorProvider.la libcmpiSensors_OpenDRIM_ComputerSystemSensorProvider_la_SOURCES = OpenDRIM_ComputerSystemSensorAccess.cpp OpenDRIM_ComputerSystemSensorProvider.cpp cmpiOpenDRIM_ComputerSystemSensor.cpp assocOpenDRIM_ComputerSystemSensor.cpp # May have to be adjusted for direct invocation libcmpiSensors_OpenDRIM_ComputerSystemSensorProvider_la_CPPFLAGS = -I../CIM_LogicalDevice -I../CIM_System # Uncomment the end for direct invocation, may have to be adjusted libcmpiSensors_OpenDRIM_ComputerSystemSensorProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la #../CIM_LogicalDevice/libcmpiSensors_CIM_LogicalDeviceProvider.la ../CIM_System/libcmpiSensors_CIM_SystemProvider.la libcmpiSensors_OpenDRIM_ComputerSystemSensorProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ComputerSystemSensor.h OpenDRIM_ComputerSystemSensor.h OpenDRIM_ComputerSystemSensorAccess.h ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/OpenDRIM_ComputerSystemSensorProvider.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/OpenDRIM_ComputerSystemSensorProvider.c0000644000175000017500000004215011401065455034604 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemSensor.h" #include "OpenDRIM_ComputerSystemSensorAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_ComputerSystemSensorProviderSetInstance Sensors_OpenDRIM_ComputerSystemSensorProviderModifyInstance #endif int Sensors_OpenDRIM_ComputerSystemSensor_init(const CMPIBroker* broker); int Sensors_OpenDRIM_ComputerSystemSensor_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_ComputerSystemSensorProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_ComputerSystemSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ComputerSystemSensorProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_ComputerSystemSensor_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_ComputerSystemSensor_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ComputerSystemSensorProviderEnumInstances(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 = Sensors_OpenDRIM_ComputerSystemSensor_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_ComputerSystemSensor_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ComputerSystemSensorProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemSensor instance; Sensors_OpenDRIM_ComputerSystemSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_ComputerSystemSensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_ComputerSystemSensor_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ComputerSystemSensorProviderSetInstance(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_ComputerSystemSensor newInstance, oldInstance; Sensors_OpenDRIM_ComputerSystemSensor_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_ComputerSystemSensor_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_ComputerSystemSensor_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_ComputerSystemSensor_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ComputerSystemSensorProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemSensor instance; Sensors_OpenDRIM_ComputerSystemSensor_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_ComputerSystemSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_ComputerSystemSensor_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_ComputerSystemSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_ComputerSystemSensor_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ComputerSystemSensorProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemSensor instance; Sensors_OpenDRIM_ComputerSystemSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_ComputerSystemSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_ComputerSystemSensor_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ComputerSystemSensorProviderExecQuery(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 Sensors_OpenDRIM_ComputerSystemSensorProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_ComputerSystemSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ComputerSystemSensorProviderAssociatorNames(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 = Sensors_OpenDRIM_ComputerSystemSensor_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_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 Sensors_OpenDRIM_ComputerSystemSensorProviderAssociators(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 = Sensors_OpenDRIM_ComputerSystemSensor_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_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 Sensors_OpenDRIM_ComputerSystemSensorProviderReferenceNames(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 = Sensors_OpenDRIM_ComputerSystemSensor_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_ComputerSystemSensor_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = Sensors_OpenDRIM_ComputerSystemSensor_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_ComputerSystemSensor_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus Sensors_OpenDRIM_ComputerSystemSensorProviderReferences(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 = Sensors_OpenDRIM_ComputerSystemSensor_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_ComputerSystemSensor_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = Sensors_OpenDRIM_ComputerSystemSensor_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = Sensors_OpenDRIM_ComputerSystemSensor_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int Sensors_OpenDRIM_ComputerSystemSensor_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_ComputerSystemSensor_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_ComputerSystemSensor_init FAILED: " + (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_ComputerSystemSensor_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_ComputerSystemSensor_unload FAILED: " + (string) OpenDRIM_ComputerSystemSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_ComputerSystemSensor_INIT if (Sensors_OpenDRIM_ComputerSystemSensor_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_ComputerSystemSensorProvider, Sensors_OpenDRIM_ComputerSystemSensorProvider, _broker, Sensors_OpenDRIM_ComputerSystemSensor_INIT); CMAssociationMIStub(Sensors_OpenDRIM_ComputerSystemSensorProvider, Sensors_OpenDRIM_ComputerSystemSensorProvider, _broker, Sensors_OpenDRIM_ComputerSystemSensor_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/cmpiOpenDRIM_ComputerSystemSensor.h0000644000175000017500000000433111401065455033746 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_COMPUTERSYSTEMSENSOR_H_ #define CMPIOPENDRIM_COMPUTERSYSTEMSENSOR_H_ #include "OpenDRIM_ComputerSystemSensor.h" CMPIObjectPath* Sensors_OpenDRIM_ComputerSystemSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ComputerSystemSensor& instance); CMPIInstance* Sensors_OpenDRIM_ComputerSystemSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ComputerSystemSensor& instance); void Sensors_OpenDRIM_ComputerSystemSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ComputerSystemSensor& instance); void Sensors_OpenDRIM_ComputerSystemSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ComputerSystemSensor& instance); #endif /*CMPIOPENDRIM_COMPUTERSYSTEMSENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/OpenDRIM_ComputerSystemSensorAccess.h0000644000175000017500000001054311401065455034221 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_COMPUTERSYSTEMSENSORACCESS_H_ #define OPENDRIM_COMPUTERSYSTEMSENSORACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_ComputerSystemSensor.h" #include "assocOpenDRIM_ComputerSystemSensor.h" int Sensors_OpenDRIM_ComputerSystemSensor_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_ComputerSystemSensor_unload(string& errorMessage); int Sensors_OpenDRIM_ComputerSystemSensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_ComputerSystemSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ComputerSystemSensor& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_ComputerSystemSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemSensor& newInstance, const OpenDRIM_ComputerSystemSensor& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_ComputerSystemSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemSensor& instance, string& errorMessage); int Sensors_OpenDRIM_ComputerSystemSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemSensor& instance, string& errorMessage); int Sensors_OpenDRIM_ComputerSystemSensor_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_ComputerSystemSensor_associatorGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const char** properties, vector& PartComponent_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_ComputerSystemSensor_referencePartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const vector& GroupComponent_instances, vector& OpenDRIM_ComputerSystemSensor_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_ComputerSystemSensor_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ComputerSystemSensor_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_ComputerSystemSensor_populate(OpenDRIM_ComputerSystemSensor& instance, string& errorMessage); #endif /*OPENDRIM_COMPUTERSYSTEMSENSORACCESS_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/assocOpenDRIM_ComputerSystemSensor.cpp0000644000175000017500000002106111401065455034460 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_ComputerSystemSensor.h" int Sensors_OpenDRIM_ComputerSystemSensor_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 = Sensors_OpenDRIM_ComputerSystemSensor_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "PartComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "GroupComponent") != 0) return OK; CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_associatorPartComponentToGroupComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "GroupComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "PartComponent") != 0) return OK; CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_associatorGroupComponentToPartComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, PartComponent_NAMESPACE, PartComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(Sensors_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_LogicalDevice_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), PartComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), PartComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_LogicalDevice _instance; Sensors_CIM_LogicalDevice_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_LogicalDevice_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_LogicalDevice_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, GroupComponent_NAMESPACE, GroupComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(Sensors_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), GroupComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), GroupComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_System _instance; Sensors_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/assocOpenDRIM_ComputerSystemSensor.h0000644000175000017500000000621311401065455034127 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_COMPUTERSYSTEMSENSOR_H_ #define ASSOCOPENDRIM_COMPUTERSYSTEMSENSOR_H_ #include "OpenDRIM_ComputerSystemSensorAccess.h" int Sensors_OpenDRIM_ComputerSystemSensor_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 Sensors_OpenDRIM_ComputerSystemSensor_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 Sensors_OpenDRIM_ComputerSystemSensor_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_ComputerSystemSensor_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_ComputerSystemSensor_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_ComputerSystemSensor_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_COMPUTERSYSTEMSENSOR_H_*/ ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/OpenDRIM_ComputerSystemSensorAccess.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_ComputerSystemSensor/OpenDRIM_ComputerSystemSensorAccess.cpp0000644000175000017500000002521711401065455034560 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ComputerSystemSensorAccess.h" int Sensors_OpenDRIM_ComputerSystemSensor_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_LogicalDevice_load(broker, errorMessage)); CF_assert(Sensors_CIM_System_load(broker, errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_LogicalDevice_unload(errorMessage)); CF_assert(Sensors_CIM_System_unload(errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_isAssociated(const Instance& PartComponent, const Instance& GroupComponent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not string sensor_creationClassName; CF_assert(PartComponent.getProperty("CreationClassName", sensor_creationClassName)); if (sensor_creationClassName.find_first_of("OpenDRIM_")==0) isAssociated=true; else isAssociated=false; _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_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(Sensors_OpenDRIM_ComputerSystemSensor_enumeratePartComponents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_enumeratePartComponents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; Sensors_OpenDRIM_ComputerSystemSensor_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), PartComponent_classnames[0], GroupComponent_classnames[0], PartComponent_role.c_str(), GroupComponent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_referencePartComponentToGroupComponent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ComputerSystemSensor& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath PartComponent_objectpath; instance.getPartComponent(PartComponent_objectpath); Instance PartComponent_instance; CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_getPartComponent(broker, ctx, PartComponent_objectpath, PartComponent_instance, NULL, errorMessage)); Objectpath GroupComponent_objectpath; instance.getGroupComponent(GroupComponent_objectpath); Instance GroupComponent_instance; CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_getGroupComponent(broker, ctx, GroupComponent_objectpath, GroupComponent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_isAssociated(PartComponent_instance, GroupComponent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemSensor& newInstance, const OpenDRIM_ComputerSystemSensor& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ComputerSystemSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ComputerSystemSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_ComputerSystemSensor_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector GroupComponent_instances; if (discriminant=="a") CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& PartComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector PartComponent_instances; if (discriminant=="a") CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(Sensors_OpenDRIM_ComputerSystemSensor_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& GroupComponent_instances, vector& OpenDRIM_ComputerSystemSensor_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < GroupComponent_instances.size(); i++) { OpenDRIM_ComputerSystemSensor instance; instance.setPartComponent(((Instance) PartComponent_instance).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instances[i]).getObjectpath()); OpenDRIM_ComputerSystemSensor_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ComputerSystemSensor_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < PartComponent_instances.size(); i++) { OpenDRIM_ComputerSystemSensor instance; instance.setPartComponent(((Instance) PartComponent_instances[i]).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instance).getObjectpath()); OpenDRIM_ComputerSystemSensor_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_ComputerSystemSensor_populate(OpenDRIM_ComputerSystemSensor& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/VERSION0000644000175000017500000000000611401065455020303 0ustar guillaumeguillaume1.0.0 opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/0000755000175000017500000000000011401065455025500 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/OpenDRIM_AssociatedBatterySensorProvider.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/OpenDRIM_AssociatedBatterySensorProv0000644000175000017500000004252611401065455034544 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedBatterySensor.h" #include "OpenDRIM_AssociatedBatterySensorAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_AssociatedBatterySensorProviderSetInstance Sensors_OpenDRIM_AssociatedBatterySensorProviderModifyInstance #endif int Sensors_OpenDRIM_AssociatedBatterySensor_init(const CMPIBroker* broker); int Sensors_OpenDRIM_AssociatedBatterySensor_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_AssociatedBatterySensorProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedBatterySensorProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedBatterySensorProviderEnumInstances(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 = Sensors_OpenDRIM_AssociatedBatterySensor_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedBatterySensorProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedBatterySensor instance; Sensors_OpenDRIM_AssociatedBatterySensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedBatterySensorProviderSetInstance(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_AssociatedBatterySensor newInstance, oldInstance; Sensors_OpenDRIM_AssociatedBatterySensor_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_AssociatedBatterySensor_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedBatterySensorProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedBatterySensor instance; Sensors_OpenDRIM_AssociatedBatterySensor_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedBatterySensorProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedBatterySensor instance; Sensors_OpenDRIM_AssociatedBatterySensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedBatterySensorProviderExecQuery(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 Sensors_OpenDRIM_AssociatedBatterySensorProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedBatterySensorProviderAssociatorNames(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 = Sensors_OpenDRIM_AssociatedBatterySensor_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_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 Sensors_OpenDRIM_AssociatedBatterySensorProviderAssociators(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 = Sensors_OpenDRIM_AssociatedBatterySensor_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_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 Sensors_OpenDRIM_AssociatedBatterySensorProviderReferenceNames(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 = Sensors_OpenDRIM_AssociatedBatterySensor_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedBatterySensorProviderReferences(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 = Sensors_OpenDRIM_AssociatedBatterySensor_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int Sensors_OpenDRIM_AssociatedBatterySensor_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_AssociatedBatterySensor_init FAILED: " + (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_AssociatedBatterySensor_unload FAILED: " + (string) OpenDRIM_AssociatedBatterySensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_AssociatedBatterySensor_INIT if (Sensors_OpenDRIM_AssociatedBatterySensor_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_AssociatedBatterySensorProvider, Sensors_OpenDRIM_AssociatedBatterySensorProvider, _broker, Sensors_OpenDRIM_AssociatedBatterySensor_INIT); CMAssociationMIStub(Sensors_OpenDRIM_AssociatedBatterySensorProvider, Sensors_OpenDRIM_AssociatedBatterySensorProvider, _broker, Sensors_OpenDRIM_AssociatedBatterySensor_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/cmpiOpenDRIM_AssociatedBatterySensor.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/cmpiOpenDRIM_AssociatedBatterySensor0000644000175000017500000000437511401065455034546 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_ASSOCIATEDBATTERYSENSOR_H_ #define CMPIOPENDRIM_ASSOCIATEDBATTERYSENSOR_H_ #include "OpenDRIM_AssociatedBatterySensor.h" CMPIObjectPath* Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedBatterySensor& instance); CMPIInstance* Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedBatterySensor& instance); void Sensors_OpenDRIM_AssociatedBatterySensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedBatterySensor& instance); void Sensors_OpenDRIM_AssociatedBatterySensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedBatterySensor& instance); #endif /*CMPIOPENDRIM_ASSOCIATEDBATTERYSENSOR_H_*/ ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/cmpiOpenDRIM_AssociatedBatterySensor.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/cmpiOpenDRIM_AssociatedBatterySensor0000644000175000017500000000611711401065455034542 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedBatterySensor.h" CMPIObjectPath* Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedBatterySensor& instance) { _E_; Objectpath op(broker, OpenDRIM_AssociatedBatterySensor_classnames[0], OpenDRIM_AssociatedBatterySensor_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedBatterySensor& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_AssociatedBatterySensor_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_AssociatedBatterySensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedBatterySensor& 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 Sensors_OpenDRIM_AssociatedBatterySensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedBatterySensor& 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-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/Makefile.am0000644000175000017500000000476211401065455027545 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_AssociatedBatterySensorProvider.la libcmpiSensors_OpenDRIM_AssociatedBatterySensorProvider_la_SOURCES = OpenDRIM_AssociatedBatterySensorAccess.cpp OpenDRIM_AssociatedBatterySensorProvider.cpp cmpiOpenDRIM_AssociatedBatterySensor.cpp assocOpenDRIM_AssociatedBatterySensor.cpp # May have to be adjusted for direct invocation libcmpiSensors_OpenDRIM_AssociatedBatterySensorProvider_la_CPPFLAGS = -I../CIM_Sensor -I../CIM_ManagedSystemElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiSensors_OpenDRIM_AssociatedBatterySensorProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la #../CIM_Sensor/libcmpiSensors_CIM_SensorProvider.la ../CIM_ManagedSystemElement/libcmpiSensors_CIM_ManagedSystemElementProvider.la libcmpiSensors_OpenDRIM_AssociatedBatterySensorProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_AssociatedBatterySensor.h OpenDRIM_AssociatedBatterySensor.h OpenDRIM_AssociatedBatterySensorAccess.h ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/assocOpenDRIM_AssociatedBatterySensor.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/assocOpenDRIM_AssociatedBatterySenso0000644000175000017500000002103111401065455034530 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_AssociatedBatterySensor.h" int Sensors_OpenDRIM_AssociatedBatterySensor_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 = Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_OpenDRIM_AssociatedBatterySensor_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_CIM_Sensor_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_Sensor_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_Sensor_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_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_Sensor _instance; Sensors_CIM_Sensor_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_Sensor_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_Sensor_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_CIM_ManagedSystemElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_ManagedSystemElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_ManagedSystemElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_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_ManagedSystemElement _instance; Sensors_CIM_ManagedSystemElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_ManagedSystemElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_ManagedSystemElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/OpenDRIM_AssociatedBatterySensor.h0000644000175000017500000000664511401065455034125 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDBATTERYSENSOR_H_ #define OPENDRIM_ASSOCIATEDBATTERYSENSOR_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Sensor.h" #include "CIM_SensorAccess.h" #include "cmpiCIM_ManagedSystemElement.h" #include "CIM_ManagedSystemElementAccess.h" */ const static char* OpenDRIM_AssociatedBatterySensor_classnames[] = {"OpenDRIM_AssociatedBatterySensor"}; static string OpenDRIM_AssociatedBatterySensor_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_BatteryTempratureSensor"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_Battery"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_AssociatedBatterySensor { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_AssociatedBatterySensor() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_AssociatedBatterySensor() {} 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_ASSOCIATEDBATTERYSENSOR_H_*/ ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/OpenDRIM_AssociatedBatterySensorAccess.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/OpenDRIM_AssociatedBatterySensorAcce0000644000175000017500000002444411401065455034450 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_AssociatedBatterySensorAccess.h" int Sensors_OpenDRIM_AssociatedBatterySensor_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_Sensor_load(broker, errorMessage)); CF_assert(Sensors_CIM_ManagedSystemElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_Sensor_unload(errorMessage)); CF_assert(Sensors_CIM_ManagedSystemElement_unload(errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_OpenDRIM_AssociatedBatterySensor_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; Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_OpenDRIM_AssociatedBatterySensor_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedBatterySensor& 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(Sensors_OpenDRIM_AssociatedBatterySensor_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(Sensors_OpenDRIM_AssociatedBatterySensor_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(Sensors_OpenDRIM_AssociatedBatterySensor_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBatterySensor& newInstance, const OpenDRIM_AssociatedBatterySensor& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_AssociatedBatterySensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBatterySensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_AssociatedBatterySensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBatterySensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_OpenDRIM_AssociatedBatterySensor_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_OpenDRIM_AssociatedBatterySensor_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_AssociatedBatterySensor_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(Sensors_OpenDRIM_AssociatedBatterySensor_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_AssociatedBatterySensor_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_AssociatedBatterySensor instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_AssociatedBatterySensor_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedBatterySensor_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_AssociatedBatterySensor instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_AssociatedBatterySensor_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedBatterySensor_populate(OpenDRIM_AssociatedBatterySensor& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/OpenDRIM_AssociatedBatterySensorAccess.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/OpenDRIM_AssociatedBatterySensorAcce0000644000175000017500000001056711401065455034451 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDBATTERYSENSORACCESS_H_ #define OPENDRIM_ASSOCIATEDBATTERYSENSORACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_AssociatedBatterySensor.h" #include "assocOpenDRIM_AssociatedBatterySensor.h" int Sensors_OpenDRIM_AssociatedBatterySensor_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_AssociatedBatterySensor_unload(string& errorMessage); int Sensors_OpenDRIM_AssociatedBatterySensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedBatterySensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedBatterySensor& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_AssociatedBatterySensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBatterySensor& newInstance, const OpenDRIM_AssociatedBatterySensor& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_AssociatedBatterySensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBatterySensor& instance, string& errorMessage); int Sensors_OpenDRIM_AssociatedBatterySensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBatterySensor& instance, string& errorMessage); int Sensors_OpenDRIM_AssociatedBatterySensor_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedBatterySensor_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedBatterySensor_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_AssociatedBatterySensor_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedBatterySensor_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedBatterySensor_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedBatterySensor_populate(OpenDRIM_AssociatedBatterySensor& instance, string& errorMessage); #endif /*OPENDRIM_ASSOCIATEDBATTERYSENSORACCESS_H_*/ ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/assocOpenDRIM_AssociatedBatterySensor.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedBatterySensor/assocOpenDRIM_AssociatedBatterySenso0000644000175000017500000000623111401065455034535 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_ASSOCIATEDBATTERYSENSOR_H_ #define ASSOCOPENDRIM_ASSOCIATEDBATTERYSENSOR_H_ #include "OpenDRIM_AssociatedBatterySensorAccess.h" int Sensors_OpenDRIM_AssociatedBatterySensor_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 Sensors_OpenDRIM_AssociatedBatterySensor_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 Sensors_OpenDRIM_AssociatedBatterySensor_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_AssociatedBatterySensor_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_AssociatedBatterySensor_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_AssociatedBatterySensor_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_ASSOCIATEDBATTERYSENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/0000755000175000017500000000000011401065455027367 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/assocOpenDRIM_AssociatedProcessorVoltageSensor.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/assocOpenDRIM_AssociatedPro0000644000175000017500000002125111401065455034541 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_AssociatedProcessorVoltageSensor.h" int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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 = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_CIM_Sensor_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_Sensor_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_Sensor_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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_Sensor _instance; Sensors_CIM_Sensor_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_Sensor_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_Sensor_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_CIM_ManagedSystemElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_ManagedSystemElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_ManagedSystemElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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_ManagedSystemElement _instance; Sensors_CIM_ManagedSystemElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_ManagedSystemElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_ManagedSystemElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/Makefile.am0000644000175000017500000000513611401065455031430 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider.la libcmpiSensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider_la_SOURCES = OpenDRIM_AssociatedProcessorVoltageSensorAccess.cpp OpenDRIM_AssociatedProcessorVoltageSensorProvider.cpp cmpiOpenDRIM_AssociatedProcessorVoltageSensor.cpp assocOpenDRIM_AssociatedProcessorVoltageSensor.cpp # May have to be adjusted for direct invocation libcmpiSensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider_la_CPPFLAGS = -I../CIM_Sensor -I../CIM_ManagedSystemElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiSensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la #../CIM_Sensor/libcmpiSensors_CIM_SensorProvider.la ../CIM_ManagedSystemElement/libcmpiSensors_CIM_ManagedSystemElementProvider.la libcmpiSensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_AssociatedProcessorVoltageSensor.h OpenDRIM_AssociatedProcessorVoltageSensor.h OpenDRIM_AssociatedProcessorVoltageSensorAccess.h ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/OpenDRIM_AssociatedProcessorVoltageSensorAccess.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/OpenDRIM_AssociatedProcesso0000644000175000017500000002645711401065455034562 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_AssociatedProcessorVoltageSensorAccess.h" int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_Sensor_load(broker, errorMessage)); CF_assert(Sensors_CIM_ManagedSystemElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_Sensor_unload(errorMessage)); CF_assert(Sensors_CIM_ManagedSystemElement_unload(errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // Determine if the association can be established or not isAssociated=false; string processor_device_id; string sensor_device_id; Antecedent.getProperty("DeviceID", processor_device_id); Dependent.getProperty("DeviceID", sensor_device_id); // processor DeviceID must be numerical if (!CF_isNumber(processor_device_id)) return OK; unsigned int _processor_device_id = atoll(processor_device_id.c_str()); // sensor DeviceID must be numerical if (!CF_isNumber(sensor_device_id)) return OK; unsigned int _sensor_device_id = atoll(sensor_device_id.c_str()); // the first element of the memory DeviceID must match the processor DeviceID if (_sensor_device_id == _processor_device_id) isAssociated=true; _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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; Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedProcessorVoltageSensor& 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(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorVoltageSensor& newInstance, const OpenDRIM_AssociatedProcessorVoltageSensor& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorVoltageSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorVoltageSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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(Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_AssociatedProcessorVoltageSensor_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_AssociatedProcessorVoltageSensor instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_AssociatedProcessorVoltageSensor_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedProcessorVoltageSensor_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_AssociatedProcessorVoltageSensor instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_AssociatedProcessorVoltageSensor_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_populate(OpenDRIM_AssociatedProcessorVoltageSensor& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/assocOpenDRIM_AssociatedProcessorVoltageSensor.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/assocOpenDRIM_AssociatedPro0000644000175000017500000000636311401065455034550 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSOR_H_ #define ASSOCOPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSOR_H_ #include "OpenDRIM_AssociatedProcessorVoltageSensorAccess.h" int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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 Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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 Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSOR_H_*/ ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/OpenDRIM_AssociatedProcessorVoltageSensor.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/OpenDRIM_AssociatedProcesso0000644000175000017500000000676711401065455034564 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSOR_H_ #define OPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSOR_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Sensor.h" #include "CIM_SensorAccess.h" #include "cmpiCIM_ManagedSystemElement.h" #include "CIM_ManagedSystemElementAccess.h" */ const static char* OpenDRIM_AssociatedProcessorVoltageSensor_classnames[] = {"OpenDRIM_AssociatedProcessorVoltageSensor"}; static string OpenDRIM_AssociatedProcessorVoltageSensor_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_ProcessorVoltageSensor"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_Processor"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_AssociatedProcessorVoltageSensor { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_AssociatedProcessorVoltageSensor() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_AssociatedProcessorVoltageSensor() {} 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_ASSOCIATEDPROCESSORVOLTAGESENSOR_H_*/ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/OpenDRIM_AssociatedProcessorVoltageSensorAccess.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/OpenDRIM_AssociatedProcesso0000644000175000017500000001116311401065455034546 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSORACCESS_H_ #define OPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSORACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_AssociatedProcessorVoltageSensor.h" #include "assocOpenDRIM_AssociatedProcessorVoltageSensor.h" int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_unload(string& errorMessage); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedProcessorVoltageSensor& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorVoltageSensor& newInstance, const OpenDRIM_AssociatedProcessorVoltageSensor& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorVoltageSensor& instance, string& errorMessage); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedProcessorVoltageSensor& instance, string& errorMessage); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_AssociatedProcessorVoltageSensor_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedProcessorVoltageSensor_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_populate(OpenDRIM_AssociatedProcessorVoltageSensor& instance, string& errorMessage); #endif /*OPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSORACCESS_H_*/ ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/cmpiOpenDRIM_AssociatedProcessorVoltageSensor.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/cmpiOpenDRIM_AssociatedProc0000644000175000017500000000455111401065455034530 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSOR_H_ #define CMPIOPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSOR_H_ #include "OpenDRIM_AssociatedProcessorVoltageSensor.h" CMPIObjectPath* Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorVoltageSensor& instance); CMPIInstance* Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorVoltageSensor& instance); void Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedProcessorVoltageSensor& instance); void Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedProcessorVoltageSensor& instance); #endif /*CMPIOPENDRIM_ASSOCIATEDPROCESSORVOLTAGESENSOR_H_*/ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/cmpiOpenDRIM_AssociatedProcessorVoltageSensor.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/cmpiOpenDRIM_AssociatedProc0000644000175000017500000000627311401065455034533 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedProcessorVoltageSensor.h" CMPIObjectPath* Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorVoltageSensor& instance) { _E_; Objectpath op(broker, OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0], OpenDRIM_AssociatedProcessorVoltageSensor_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedProcessorVoltageSensor& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedProcessorVoltageSensor& 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 Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedProcessorVoltageSensor& 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_; } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/OpenDRIM_AssociatedProcessorVoltageSensorProvider.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedProcessorVoltageSensor/OpenDRIM_AssociatedProcesso0000644000175000017500000004420011401065455034544 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedProcessorVoltageSensor.h" #include "OpenDRIM_AssociatedProcessorVoltageSensorAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderSetInstance Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderModifyInstance #endif int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_init(const CMPIBroker* broker); int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderEnumInstances(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 = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorVoltageSensor instance; Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderSetInstance(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_AssociatedProcessorVoltageSensor newInstance, oldInstance; Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorVoltageSensor instance; Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedProcessorVoltageSensor instance; Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderExecQuery(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 Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderAssociatorNames(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 = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_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 Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderAssociators(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 = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_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 Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderReferenceNames(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 = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProviderReferences(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 = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_init FAILED: " + (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_unload FAILED: " + (string) OpenDRIM_AssociatedProcessorVoltageSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_INIT if (Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider, Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider, _broker, Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_INIT); CMAssociationMIStub(Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider, Sensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider, _broker, Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-sensors-1.0.0~ppa/test/0000755000175000017500000000000011401065455020216 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/test/Makefile.am0000644000175000017500000001614611401065455022262 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ noinst_PROGRAMS = testOpenDRIM_AssociatedProcessorVoltageSensor testOpenDRIM_SensorConformsToProfile testOpenDRIM_SensorCapabilities testOpenDRIM_BatteryTempratureSensor testOpenDRIM_ComputerSystemSensor testOpenDRIM_Sensor testOpenDRIM_RegisteredSensorsProfile testOpenDRIM_ProcessorVoltageSensor testOpenDRIM_AssociatedBatterySensor testOpenDRIM_NumericSensor testOpenDRIM_AssociatedSensor testOpenDRIM_EnabledSensorCapabilities # May have to be adjusted for direct invocation testOpenDRIM_AssociatedProcessorVoltageSensor_CPPFLAGS = -I../OpenDRIM_AssociatedProcessorVoltageSensor/ -I../null/ -I../null/ testOpenDRIM_AssociatedProcessorVoltageSensor_SOURCES = testOpenDRIM_AssociatedProcessorVoltageSensor.cpp testOpenDRIM_AssociatedProcessorVoltageSensor_LDADD = ../OpenDRIM_AssociatedProcessorVoltageSensor/libcmpiSensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider.la test-OpenDRIM_AssociatedProcessorVoltageSensor: testOpenDRIM_AssociatedProcessorVoltageSensor ./testOpenDRIM_AssociatedProcessorVoltageSensor # May have to be adjusted for direct invocation testOpenDRIM_SensorConformsToProfile_CPPFLAGS = -I../OpenDRIM_SensorConformsToProfile/ -I../null/ -I../null/ testOpenDRIM_SensorConformsToProfile_SOURCES = testOpenDRIM_SensorConformsToProfile.cpp testOpenDRIM_SensorConformsToProfile_LDADD = ../OpenDRIM_SensorConformsToProfile/libcmpiSensors_OpenDRIM_SensorConformsToProfileProvider.la test-OpenDRIM_SensorConformsToProfile: testOpenDRIM_SensorConformsToProfile ./testOpenDRIM_SensorConformsToProfile # May have to be adjusted for direct invocation testOpenDRIM_SensorCapabilities_CPPFLAGS = -I../OpenDRIM_SensorCapabilities/ -I../null/ -I../null/ testOpenDRIM_SensorCapabilities_SOURCES = testOpenDRIM_SensorCapabilities.cpp testOpenDRIM_SensorCapabilities_LDADD = ../OpenDRIM_SensorCapabilities/libcmpiSensors_OpenDRIM_SensorCapabilitiesProvider.la test-OpenDRIM_SensorCapabilities: testOpenDRIM_SensorCapabilities ./testOpenDRIM_SensorCapabilities testOpenDRIM_BatteryTempratureSensor_CPPFLAGS = -I../OpenDRIM_BatteryTempratureSensor/ testOpenDRIM_BatteryTempratureSensor_SOURCES = testOpenDRIM_BatteryTempratureSensor.cpp testOpenDRIM_BatteryTempratureSensor_LDADD = ../OpenDRIM_BatteryTempratureSensor/libcmpiSensors_OpenDRIM_BatteryTempratureSensorProvider.la test-OpenDRIM_BatteryTempratureSensor: testOpenDRIM_BatteryTempratureSensor ./testOpenDRIM_BatteryTempratureSensor # May have to be adjusted for direct invocation testOpenDRIM_ComputerSystemSensor_CPPFLAGS = -I../OpenDRIM_ComputerSystemSensor/ -I../null/ -I../null/ testOpenDRIM_ComputerSystemSensor_SOURCES = testOpenDRIM_ComputerSystemSensor.cpp testOpenDRIM_ComputerSystemSensor_LDADD = ../OpenDRIM_ComputerSystemSensor/libcmpiSensors_OpenDRIM_ComputerSystemSensorProvider.la test-OpenDRIM_ComputerSystemSensor: testOpenDRIM_ComputerSystemSensor ./testOpenDRIM_ComputerSystemSensor testOpenDRIM_Sensor_CPPFLAGS = -I../OpenDRIM_Sensor/ testOpenDRIM_Sensor_SOURCES = testOpenDRIM_Sensor.cpp testOpenDRIM_Sensor_LDADD = ../OpenDRIM_Sensor/libcmpiSensors_OpenDRIM_SensorProvider.la test-OpenDRIM_Sensor: testOpenDRIM_Sensor ./testOpenDRIM_Sensor testOpenDRIM_RegisteredSensorsProfile_CPPFLAGS = -I../OpenDRIM_RegisteredSensorsProfile/ testOpenDRIM_RegisteredSensorsProfile_SOURCES = testOpenDRIM_RegisteredSensorsProfile.cpp testOpenDRIM_RegisteredSensorsProfile_LDADD = ../OpenDRIM_RegisteredSensorsProfile/libcmpiSensors_OpenDRIM_RegisteredSensorsProfileProvider.la test-OpenDRIM_RegisteredSensorsProfile: testOpenDRIM_RegisteredSensorsProfile ./testOpenDRIM_RegisteredSensorsProfile testOpenDRIM_ProcessorVoltageSensor_CPPFLAGS = -I../OpenDRIM_ProcessorVoltageSensor/ testOpenDRIM_ProcessorVoltageSensor_SOURCES = testOpenDRIM_ProcessorVoltageSensor.cpp testOpenDRIM_ProcessorVoltageSensor_LDADD = ../OpenDRIM_ProcessorVoltageSensor/libcmpiSensors_OpenDRIM_ProcessorVoltageSensorProvider.la test-OpenDRIM_ProcessorVoltageSensor: testOpenDRIM_ProcessorVoltageSensor ./testOpenDRIM_ProcessorVoltageSensor # May have to be adjusted for direct invocation testOpenDRIM_AssociatedBatterySensor_CPPFLAGS = -I../OpenDRIM_AssociatedBatterySensor/ -I../null/ -I../null/ testOpenDRIM_AssociatedBatterySensor_SOURCES = testOpenDRIM_AssociatedBatterySensor.cpp testOpenDRIM_AssociatedBatterySensor_LDADD = ../OpenDRIM_AssociatedBatterySensor/libcmpiSensors_OpenDRIM_AssociatedBatterySensorProvider.la test-OpenDRIM_AssociatedBatterySensor: testOpenDRIM_AssociatedBatterySensor ./testOpenDRIM_AssociatedBatterySensor testOpenDRIM_NumericSensor_CPPFLAGS = -I../OpenDRIM_NumericSensor/ testOpenDRIM_NumericSensor_SOURCES = testOpenDRIM_NumericSensor.cpp testOpenDRIM_NumericSensor_LDADD = ../OpenDRIM_NumericSensor/libcmpiSensors_OpenDRIM_NumericSensorProvider.la test-OpenDRIM_NumericSensor: testOpenDRIM_NumericSensor ./testOpenDRIM_NumericSensor # May have to be adjusted for direct invocation testOpenDRIM_AssociatedSensor_CPPFLAGS = -I../OpenDRIM_AssociatedSensor/ -I../null/ -I../null/ testOpenDRIM_AssociatedSensor_SOURCES = testOpenDRIM_AssociatedSensor.cpp testOpenDRIM_AssociatedSensor_LDADD = ../OpenDRIM_AssociatedSensor/libcmpiSensors_OpenDRIM_AssociatedSensorProvider.la test-OpenDRIM_AssociatedSensor: testOpenDRIM_AssociatedSensor ./testOpenDRIM_AssociatedSensor testOpenDRIM_EnabledSensorCapabilities_CPPFLAGS = -I../OpenDRIM_EnabledSensorCapabilities/ testOpenDRIM_EnabledSensorCapabilities_SOURCES = testOpenDRIM_EnabledSensorCapabilities.cpp testOpenDRIM_EnabledSensorCapabilities_LDADD = ../OpenDRIM_EnabledSensorCapabilities/libcmpiSensors_OpenDRIM_EnabledSensorCapabilitiesProvider.la test-OpenDRIM_EnabledSensorCapabilities: testOpenDRIM_EnabledSensorCapabilities ./testOpenDRIM_EnabledSensorCapabilities opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_NumericSensor.cpp0000644000175000017500000002211611401065455026055 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_NumericSensor.h" #include "OpenDRIM_NumericSensorAccess.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_NumericSensor& instance) { os << " [OpenDRIM_NumericSensor]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToStringInt("SensorType", SensorType, SensorType_isNULL); ToString("OtherSensorTypeDescription", OtherSensorTypeDescription, OtherSensorTypeDescription_isNULL); ToStringArray("PossibleStates", PossibleStates, PossibleStates_isNULL); ToString("CurrentState", CurrentState, CurrentState_isNULL); ToString("PollingInterval", PollingInterval, PollingInterval_isNULL); ToStringInt("BaseUnits", BaseUnits, BaseUnits_isNULL); ToString("UnitModifier", UnitModifier, UnitModifier_isNULL); ToStringInt("RateUnits", RateUnits, RateUnits_isNULL); ToString("CurrentReading", CurrentReading, CurrentReading_isNULL); ToString("NominalReading", NominalReading, NominalReading_isNULL); ToString("NormalMax", NormalMax, NormalMax_isNULL); ToString("NormalMin", NormalMin, NormalMin_isNULL); ToString("MaxReadable", MaxReadable, MaxReadable_isNULL); ToString("MinReadable", MinReadable, MinReadable_isNULL); ToString("Resolution", Resolution, Resolution_isNULL); ToString("Tolerance", Tolerance, Tolerance_isNULL); ToString("Accuracy", Accuracy, Accuracy_isNULL); ToString("IsLinear", IsLinear, IsLinear_isNULL); ToString("Hysteresis", Hysteresis, Hysteresis_isNULL); ToString("LowerThresholdNonCritical", LowerThresholdNonCritical, LowerThresholdNonCritical_isNULL); ToString("UpperThresholdNonCritical", UpperThresholdNonCritical, UpperThresholdNonCritical_isNULL); ToString("LowerThresholdCritical", LowerThresholdCritical, LowerThresholdCritical_isNULL); ToString("UpperThresholdCritical", UpperThresholdCritical, UpperThresholdCritical_isNULL); ToString("LowerThresholdFatal", LowerThresholdFatal, LowerThresholdFatal_isNULL); ToString("UpperThresholdFatal", UpperThresholdFatal, UpperThresholdFatal_isNULL); ToStringArrayInt("SupportedThresholds", SupportedThresholds, SupportedThresholds_isNULL); ToStringArrayInt("EnabledThresholds", EnabledThresholds, EnabledThresholds_isNULL); ToStringArrayInt("SettableThresholds", SettableThresholds, SettableThresholds_isNULL); os << " [\\OpenDRIM_NumericSensor]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_NumericSensor_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_NumericSensor_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 = Sensors_OpenDRIM_NumericSensor_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 = Sensors_OpenDRIM_NumericSensor_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 = Sensors_OpenDRIM_NumericSensor_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_SensorCapabilities.cpp0000644000175000017500000001131211401065455027040 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_SensorCapabilities.h" #include "OpenDRIM_SensorCapabilitiesAccess.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_SensorCapabilities& instance) { os << " [OpenDRIM_SensorCapabilities]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("Capabilities", Capabilities, Capabilities_isNULL); ToStringArrayInt("Characteristics", Characteristics, Characteristics_isNULL); os << " [\\OpenDRIM_SensorCapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_SensorCapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_SensorCapabilities_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 = Sensors_OpenDRIM_SensorCapabilities_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 = Sensors_OpenDRIM_SensorCapabilities_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 = Sensors_OpenDRIM_SensorCapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_ComputerSystemSensor.cpp0000644000175000017500000001122611401065455027456 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemSensor.h" #include "OpenDRIM_ComputerSystemSensorAccess.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_ComputerSystemSensor& instance) { os << " [OpenDRIM_ComputerSystemSensor]" << endl; ToStringRef("GroupComponent", GroupComponent, GroupComponent_isNULL); ToStringRef("PartComponent", PartComponent, PartComponent_isNULL); os << " [\\OpenDRIM_ComputerSystemSensor]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_ComputerSystemSensor_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_ComputerSystemSensor_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 = Sensors_OpenDRIM_ComputerSystemSensor_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 = Sensors_OpenDRIM_ComputerSystemSensor_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 = Sensors_OpenDRIM_ComputerSystemSensor_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_AssociatedSensor.cpp0000644000175000017500000001111611401065455026530 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedSensor.h" #include "OpenDRIM_AssociatedSensorAccess.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_AssociatedSensor& instance) { os << " [OpenDRIM_AssociatedSensor]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_AssociatedSensor]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedSensor_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_AssociatedSensor_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 = Sensors_OpenDRIM_AssociatedSensor_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 = Sensors_OpenDRIM_AssociatedSensor_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 = Sensors_OpenDRIM_AssociatedSensor_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_Sensor.cpp0000644000175000017500000001665311401065455024543 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Sensor.h" #include "OpenDRIM_SensorAccess.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_Sensor& instance) { os << " [OpenDRIM_Sensor]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToStringInt("SensorType", SensorType, SensorType_isNULL); ToString("OtherSensorTypeDescription", OtherSensorTypeDescription, OtherSensorTypeDescription_isNULL); ToStringArray("PossibleStates", PossibleStates, PossibleStates_isNULL); ToString("CurrentState", CurrentState, CurrentState_isNULL); ToString("PollingInterval", PollingInterval, PollingInterval_isNULL); os << " [\\OpenDRIM_Sensor]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_Sensor_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_Sensor_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 = Sensors_OpenDRIM_Sensor_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 = Sensors_OpenDRIM_Sensor_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 = Sensors_OpenDRIM_Sensor_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_ProcessorVoltageSensor.cpp0000644000175000017500000002227211401065455027757 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ProcessorVoltageSensor.h" #include "OpenDRIM_ProcessorVoltageSensorAccess.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_ProcessorVoltageSensor& instance) { os << " [OpenDRIM_ProcessorVoltageSensor]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToStringInt("SensorType", SensorType, SensorType_isNULL); ToString("OtherSensorTypeDescription", OtherSensorTypeDescription, OtherSensorTypeDescription_isNULL); ToStringArray("PossibleStates", PossibleStates, PossibleStates_isNULL); ToString("CurrentState", CurrentState, CurrentState_isNULL); ToString("PollingInterval", PollingInterval, PollingInterval_isNULL); ToStringInt("BaseUnits", BaseUnits, BaseUnits_isNULL); ToString("UnitModifier", UnitModifier, UnitModifier_isNULL); ToStringInt("RateUnits", RateUnits, RateUnits_isNULL); ToString("CurrentReading", CurrentReading, CurrentReading_isNULL); ToString("NominalReading", NominalReading, NominalReading_isNULL); ToString("NormalMax", NormalMax, NormalMax_isNULL); ToString("NormalMin", NormalMin, NormalMin_isNULL); ToString("MaxReadable", MaxReadable, MaxReadable_isNULL); ToString("MinReadable", MinReadable, MinReadable_isNULL); ToString("Resolution", Resolution, Resolution_isNULL); ToString("Tolerance", Tolerance, Tolerance_isNULL); ToString("Accuracy", Accuracy, Accuracy_isNULL); ToString("IsLinear", IsLinear, IsLinear_isNULL); ToString("Hysteresis", Hysteresis, Hysteresis_isNULL); ToString("LowerThresholdNonCritical", LowerThresholdNonCritical, LowerThresholdNonCritical_isNULL); ToString("UpperThresholdNonCritical", UpperThresholdNonCritical, UpperThresholdNonCritical_isNULL); ToString("LowerThresholdCritical", LowerThresholdCritical, LowerThresholdCritical_isNULL); ToString("UpperThresholdCritical", UpperThresholdCritical, UpperThresholdCritical_isNULL); ToString("LowerThresholdFatal", LowerThresholdFatal, LowerThresholdFatal_isNULL); ToString("UpperThresholdFatal", UpperThresholdFatal, UpperThresholdFatal_isNULL); ToStringArrayInt("SupportedThresholds", SupportedThresholds, SupportedThresholds_isNULL); ToStringArrayInt("EnabledThresholds", EnabledThresholds, EnabledThresholds_isNULL); ToStringArrayInt("SettableThresholds", SettableThresholds, SettableThresholds_isNULL); os << " [\\OpenDRIM_ProcessorVoltageSensor]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_ProcessorVoltageSensor_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 = Sensors_OpenDRIM_ProcessorVoltageSensor_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 = Sensors_OpenDRIM_ProcessorVoltageSensor_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 = Sensors_OpenDRIM_ProcessorVoltageSensor_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_AssociatedBatterySensor.cpp0000644000175000017500000001124211401065455030063 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedBatterySensor.h" #include "OpenDRIM_AssociatedBatterySensorAccess.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_AssociatedBatterySensor& instance) { os << " [OpenDRIM_AssociatedBatterySensor]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_AssociatedBatterySensor]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_AssociatedBatterySensor_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 = Sensors_OpenDRIM_AssociatedBatterySensor_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 = Sensors_OpenDRIM_AssociatedBatterySensor_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 = Sensors_OpenDRIM_AssociatedBatterySensor_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_AssociatedProcessorVoltageSensor.cpp0000644000175000017500000001141611401065455031755 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedProcessorVoltageSensor.h" #include "OpenDRIM_AssociatedProcessorVoltageSensorAccess.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_AssociatedProcessorVoltageSensor& instance) { os << " [OpenDRIM_AssociatedProcessorVoltageSensor]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_AssociatedProcessorVoltageSensor]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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 = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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 = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_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 = Sensors_OpenDRIM_AssociatedProcessorVoltageSensor_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_SensorConformsToProfile.cpp0000644000175000017500000001131111401065455030060 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_SensorConformsToProfile.h" #include "OpenDRIM_SensorConformsToProfileAccess.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_SensorConformsToProfile& instance) { os << " [OpenDRIM_SensorConformsToProfile]" << endl; ToStringRef("ConformantStandard", ConformantStandard, ConformantStandard_isNULL); ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); os << " [\\OpenDRIM_SensorConformsToProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_SensorConformsToProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_SensorConformsToProfile_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 = Sensors_OpenDRIM_SensorConformsToProfile_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 = Sensors_OpenDRIM_SensorConformsToProfile_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 = Sensors_OpenDRIM_SensorConformsToProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_EnabledSensorCapabilities.cpp0000644000175000017500000001220711401065455030317 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_EnabledSensorCapabilities.h" #include "OpenDRIM_EnabledSensorCapabilitiesAccess.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_EnabledSensorCapabilities& instance) { os << " [OpenDRIM_EnabledSensorCapabilities]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("ElementNameEditSupported", ElementNameEditSupported, ElementNameEditSupported_isNULL); ToStringInt("MaxElementNameLen", MaxElementNameLen, MaxElementNameLen_isNULL); ToStringArrayInt("RequestedStatesSupported", RequestedStatesSupported, RequestedStatesSupported_isNULL); ToString("ElementNameMask", ElementNameMask, ElementNameMask_isNULL); os << " [\\OpenDRIM_EnabledSensorCapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_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 = Sensors_OpenDRIM_EnabledSensorCapabilities_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 = Sensors_OpenDRIM_EnabledSensorCapabilities_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 = Sensors_OpenDRIM_EnabledSensorCapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_BatteryTempratureSensor.cpp0000644000175000017500000001716711401065455030150 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BatteryTempratureSensor.h" #include "OpenDRIM_BatteryTempratureSensorAccess.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_BatteryTempratureSensor& instance) { os << " [OpenDRIM_BatteryTempratureSensor]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToStringInt("SensorType", SensorType, SensorType_isNULL); ToString("OtherSensorTypeDescription", OtherSensorTypeDescription, OtherSensorTypeDescription_isNULL); ToStringArray("PossibleStates", PossibleStates, PossibleStates_isNULL); ToString("CurrentState", CurrentState, CurrentState_isNULL); ToString("PollingInterval", PollingInterval, PollingInterval_isNULL); os << " [\\OpenDRIM_BatteryTempratureSensor]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_BatteryTempratureSensor_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 = Sensors_OpenDRIM_BatteryTempratureSensor_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 = Sensors_OpenDRIM_BatteryTempratureSensor_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 = Sensors_OpenDRIM_BatteryTempratureSensor_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/test/testOpenDRIM_RegisteredSensorsProfile.cpp0000644000175000017500000001245111401065455030255 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredSensorsProfile.h" #include "OpenDRIM_RegisteredSensorsProfileAccess.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_RegisteredSensorsProfile& instance) { os << " [OpenDRIM_RegisteredSensorsProfile]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToStringInt("RegisteredOrganization", RegisteredOrganization, RegisteredOrganization_isNULL); ToString("OtherRegisteredOrganization", OtherRegisteredOrganization, OtherRegisteredOrganization_isNULL); ToString("RegisteredName", RegisteredName, RegisteredName_isNULL); ToString("RegisteredVersion", RegisteredVersion, RegisteredVersion_isNULL); ToStringArrayInt("AdvertiseTypes", AdvertiseTypes, AdvertiseTypes_isNULL); ToStringArray("AdvertiseTypeDescriptions", AdvertiseTypeDescriptions, AdvertiseTypeDescriptions_isNULL); os << " [\\OpenDRIM_RegisteredSensorsProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_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 = Sensors_OpenDRIM_RegisteredSensorsProfile_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 = Sensors_OpenDRIM_RegisteredSensorsProfile_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 = Sensors_OpenDRIM_RegisteredSensorsProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedSensor/0000755000175000017500000000000011401065455024145 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedSensor/Makefile.am0000644000175000017500000000463611401065455026212 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_AssociatedSensorProvider.la libcmpiSensors_OpenDRIM_AssociatedSensorProvider_la_SOURCES = OpenDRIM_AssociatedSensorAccess.cpp OpenDRIM_AssociatedSensorProvider.cpp cmpiOpenDRIM_AssociatedSensor.cpp assocOpenDRIM_AssociatedSensor.cpp # May have to be adjusted for direct invocation libcmpiSensors_OpenDRIM_AssociatedSensorProvider_la_CPPFLAGS = -I../CIM_Sensor -I../CIM_ManagedSystemElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiSensors_OpenDRIM_AssociatedSensorProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la #../CIM_Sensor/libcmpiSensors_CIM_SensorProvider.la ../CIM_ManagedSystemElement/libcmpiSensors_CIM_ManagedSystemElementProvider.la libcmpiSensors_OpenDRIM_AssociatedSensorProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_AssociatedSensor.h OpenDRIM_AssociatedSensor.h OpenDRIM_AssociatedSensorAccess.h opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedSensor/OpenDRIM_AssociatedSensor.h0000644000175000017500000000653011401065455031230 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDSENSOR_H_ #define OPENDRIM_ASSOCIATEDSENSOR_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Sensor.h" #include "CIM_SensorAccess.h" #include "cmpiCIM_ManagedSystemElement.h" #include "CIM_ManagedSystemElementAccess.h" */ const static char* OpenDRIM_AssociatedSensor_classnames[] = {"OpenDRIM_AssociatedSensor"}; static string OpenDRIM_AssociatedSensor_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"CIM_Sensor"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"CIM_ManagedSystemElement"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_AssociatedSensor { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_AssociatedSensor() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_AssociatedSensor() {} 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_ASSOCIATEDSENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedSensor/assocOpenDRIM_AssociatedSensor.h0000644000175000017500000000612311401065455032257 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_ASSOCIATEDSENSOR_H_ #define ASSOCOPENDRIM_ASSOCIATEDSENSOR_H_ #include "OpenDRIM_AssociatedSensorAccess.h" int Sensors_OpenDRIM_AssociatedSensor_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 Sensors_OpenDRIM_AssociatedSensor_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 Sensors_OpenDRIM_AssociatedSensor_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_AssociatedSensor_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_AssociatedSensor_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Sensors_OpenDRIM_AssociatedSensor_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_ASSOCIATEDSENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedSensor/OpenDRIM_AssociatedSensorAccess.h0000644000175000017500000001026311401065455032350 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDSENSORACCESS_H_ #define OPENDRIM_ASSOCIATEDSENSORACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_AssociatedSensor.h" #include "assocOpenDRIM_AssociatedSensor.h" int Sensors_OpenDRIM_AssociatedSensor_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_AssociatedSensor_unload(string& errorMessage); int Sensors_OpenDRIM_AssociatedSensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedSensor& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_AssociatedSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedSensor& newInstance, const OpenDRIM_AssociatedSensor& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_AssociatedSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedSensor& instance, string& errorMessage); int Sensors_OpenDRIM_AssociatedSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedSensor& instance, string& errorMessage); int Sensors_OpenDRIM_AssociatedSensor_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedSensor_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedSensor_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_AssociatedSensor_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedSensor_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedSensor_instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_AssociatedSensor_populate(OpenDRIM_AssociatedSensor& instance, string& errorMessage); #endif /*OPENDRIM_ASSOCIATEDSENSORACCESS_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedSensor/OpenDRIM_AssociatedSensorAccess.cpp0000644000175000017500000002376011401065455032711 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_AssociatedSensorAccess.h" int Sensors_OpenDRIM_AssociatedSensor_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_Sensor_load(broker, errorMessage)); CF_assert(Sensors_CIM_ManagedSystemElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Sensors_CIM_Sensor_unload(errorMessage)); CF_assert(Sensors_CIM_ManagedSystemElement_unload(errorMessage)); */ // TODO _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_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(Sensors_OpenDRIM_AssociatedSensor_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(Sensors_OpenDRIM_AssociatedSensor_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; Sensors_OpenDRIM_AssociatedSensor_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(Sensors_OpenDRIM_AssociatedSensor_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedSensor& 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(Sensors_OpenDRIM_AssociatedSensor_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(Sensors_OpenDRIM_AssociatedSensor_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(Sensors_OpenDRIM_AssociatedSensor_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedSensor& newInstance, const OpenDRIM_AssociatedSensor& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_AssociatedSensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_AssociatedSensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedSensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_AssociatedSensor_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(Sensors_OpenDRIM_AssociatedSensor_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_AssociatedSensor_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(Sensors_OpenDRIM_AssociatedSensor_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(Sensors_OpenDRIM_AssociatedSensor_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Sensors_OpenDRIM_AssociatedSensor_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(Sensors_OpenDRIM_AssociatedSensor_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_AssociatedSensor_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_AssociatedSensor instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_AssociatedSensor_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedSensor_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_AssociatedSensor instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_AssociatedSensor_instances.push_back(instance); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_populate(OpenDRIM_AssociatedSensor& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedSensor/cmpiOpenDRIM_AssociatedSensor.h0000644000175000017500000000425111401065455032077 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_ASSOCIATEDSENSOR_H_ #define CMPIOPENDRIM_ASSOCIATEDSENSOR_H_ #include "OpenDRIM_AssociatedSensor.h" CMPIObjectPath* Sensors_OpenDRIM_AssociatedSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedSensor& instance); CMPIInstance* Sensors_OpenDRIM_AssociatedSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedSensor& instance); void Sensors_OpenDRIM_AssociatedSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedSensor& instance); void Sensors_OpenDRIM_AssociatedSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedSensor& instance); #endif /*CMPIOPENDRIM_ASSOCIATEDSENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedSensor/cmpiOpenDRIM_AssociatedSensor.cpp0000644000175000017500000000577311401065455032444 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedSensor.h" CMPIObjectPath* Sensors_OpenDRIM_AssociatedSensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedSensor& instance) { _E_; Objectpath op(broker, OpenDRIM_AssociatedSensor_classnames[0], OpenDRIM_AssociatedSensor_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_AssociatedSensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedSensor& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_AssociatedSensor_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_AssociatedSensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedSensor& 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 Sensors_OpenDRIM_AssociatedSensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedSensor& 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-sensors-1.0.0~ppa/OpenDRIM_AssociatedSensor/assocOpenDRIM_AssociatedSensor.cpp0000644000175000017500000002065111401065455032614 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_AssociatedSensor.h" int Sensors_OpenDRIM_AssociatedSensor_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 = Sensors_OpenDRIM_AssociatedSensor_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(Sensors_OpenDRIM_AssociatedSensor_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(Sensors_OpenDRIM_AssociatedSensor_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_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(Sensors_CIM_Sensor_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_Sensor_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_Sensor_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_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_Sensor _instance; Sensors_CIM_Sensor_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_Sensor_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_Sensor_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_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(Sensors_CIM_ManagedSystemElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Sensors_CIM_ManagedSystemElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Sensors_CIM_ManagedSystemElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_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_ManagedSystemElement _instance; Sensors_CIM_ManagedSystemElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Sensors_CIM_ManagedSystemElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Sensors_CIM_ManagedSystemElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_AssociatedSensor/OpenDRIM_AssociatedSensorProvider.cpp0000644000175000017500000004134011401065455033274 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedSensor.h" #include "OpenDRIM_AssociatedSensorAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_AssociatedSensorProviderSetInstance Sensors_OpenDRIM_AssociatedSensorProviderModifyInstance #endif int Sensors_OpenDRIM_AssociatedSensor_init(const CMPIBroker* broker); int Sensors_OpenDRIM_AssociatedSensor_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_AssociatedSensorProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_AssociatedSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedSensorProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedSensor_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_AssociatedSensor_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedSensorProviderEnumInstances(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 = Sensors_OpenDRIM_AssociatedSensor_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_AssociatedSensor_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedSensorProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedSensor instance; Sensors_OpenDRIM_AssociatedSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedSensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_AssociatedSensor_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedSensorProviderSetInstance(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_AssociatedSensor newInstance, oldInstance; Sensors_OpenDRIM_AssociatedSensor_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_AssociatedSensor_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedSensor_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedSensor_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedSensorProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedSensor instance; Sensors_OpenDRIM_AssociatedSensor_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedSensor_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_AssociatedSensor_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedSensorProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedSensor instance; Sensors_OpenDRIM_AssociatedSensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedSensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_AssociatedSensor_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedSensorProviderExecQuery(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 Sensors_OpenDRIM_AssociatedSensorProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_AssociatedSensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedSensorProviderAssociatorNames(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 = Sensors_OpenDRIM_AssociatedSensor_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_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 Sensors_OpenDRIM_AssociatedSensorProviderAssociators(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 = Sensors_OpenDRIM_AssociatedSensor_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_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 Sensors_OpenDRIM_AssociatedSensorProviderReferenceNames(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 = Sensors_OpenDRIM_AssociatedSensor_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_AssociatedSensor_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = Sensors_OpenDRIM_AssociatedSensor_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_AssociatedSensor_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus Sensors_OpenDRIM_AssociatedSensorProviderReferences(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 = Sensors_OpenDRIM_AssociatedSensor_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Sensors_OpenDRIM_AssociatedSensor_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = Sensors_OpenDRIM_AssociatedSensor_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = Sensors_OpenDRIM_AssociatedSensor_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int Sensors_OpenDRIM_AssociatedSensor_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedSensor_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_AssociatedSensor_init FAILED: " + (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_AssociatedSensor_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_AssociatedSensor_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_AssociatedSensor_unload FAILED: " + (string) OpenDRIM_AssociatedSensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_AssociatedSensor_INIT if (Sensors_OpenDRIM_AssociatedSensor_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_AssociatedSensorProvider, Sensors_OpenDRIM_AssociatedSensorProvider, _broker, Sensors_OpenDRIM_AssociatedSensor_INIT); CMAssociationMIStub(Sensors_OpenDRIM_AssociatedSensorProvider, Sensors_OpenDRIM_AssociatedSensorProvider, _broker, Sensors_OpenDRIM_AssociatedSensor_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-sensors-1.0.0~ppa/acinclude.m40000644000175000017500000002104411401065455021431 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ AC_DEFUN([SHOW_COPYRIGHT], [ echo "################################################################################# # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public 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-sensors-1.0.0~ppa/Common/0000755000175000017500000000000011401065455020467 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/Common/Sensors_Common.h0000644000175000017500000001030311401065455023601 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef SENSORS_COMMON_H_ #define SENSORS_COMMON_H_ #include // CacheAccess/Core: cache memory can be shared between multiple cores // Family Model Stepping Registers CacheAccess/Core (shared / independant / none) const static char* _GenuineIntel_CPUs[][5] = { // Genuine Intel(R) CPU {"6", "14", "8", "x86", "shared"},\ // Intel(R) Core(TM)2 CPU {"6", "15", "6", "ia64", "shared"},\ // Intel(R) Pentium(R) 4 CPU {"15", "2", "9", "x86", "none"},\ // Intel(R) Xeon(TM) CPU {"15", "6", "4", "ia64", "independant"} }; // Family Model Stepping Registers CacheAccess/Core (shared / independant / none) const static char* _AuthenticAMD_Processors[][5] = { // AMD-K7(tm) Processor {"6", "1", "2", "x86", "none"},\ // mobile AMD Athlon(tm) XP {"6", "8", "0", "x86", "none"},\ // Dual Core AMD Opteron(tm) Processor {"15", "33", "2", "x86_64", "independant"},\ // AMD Athlon(tm) 64 Processor {"15", "47", "2", "x86_64", "none"},\ // AMD Athlon(tm) 64 X2 Dual Core Processor {"15", "75", "2", "x86_64", "independant"},\ {"15", "67", "3", "x86_64", "independant"} }; typedef struct { unsigned short nb_hardware_thread; vector hardware_thread_load_averages; vector previous_hardware_thread_idle_cputimes; vector previous_hardware_thread_total_cputimes; bool associated_cache_memory; unsigned long long cache_memory_size; // in kHz unsigned long current_freq; unsigned short load_average; } _processor_core; typedef struct { vector<_processor_core> processor_cores; bool associated_cache_memory; // in KBytes unsigned long long cache_memory_size; unsigned short family; unsigned short model; unsigned short stepping; // x86, s390, ppc, x86_64, ia64, generic string architecture; string vendor; string name; unsigned short physical_address_size; unsigned short virtual_address_size; unsigned short load_average; } _processor_topology; string CPU_printProcessors(const vector<_processor_topology>& processors); void CPU_setCoreToDefault(_processor_core& processor_core); void CPU_setTopologyToDefault(_processor_topology& processor_topology); void CPU_findProcessorArchitecture(_processor_topology& topology); int CPU_getProcessors(const string& cpuinfo_path, vector<_processor_topology>& processors, string& errorMessage); int CPU_getLoadAverages(vector<_processor_topology>& new_processors, const vector<_processor_topology>& old_processors, string& errorMessage); #endif /*SENSORS_COMMON_H_*/ opendrim-lmp-sensors-1.0.0~ppa/Common/Makefile.am0000644000175000017500000000336011401065455022525 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ commonlibdir = @COMMONLIBDIR@ commonlib_LTLIBRARIES = libcmpiSensors_Common.la libcmpiSensors_Common_la_SOURCES = Sensors_Common.cpp libcmpiSensors_Common_la_LDFLAGS = -avoid-version libcmpiSensors_Common_la_LIBADD = -lopendrim noinst_HEADERS = Sensors_Common.h opendrim-lmp-sensors-1.0.0~ppa/Common/Sensors_Common.cpp0000644000175000017500000004363611401065455024153 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "Sensors_Common.h" string CPU_printProcessors(const vector<_processor_topology>& processors) { _E_; string processors_string; for (unsigned long i = 0; i < processors.size(); i ++) { processors_string += "Processor " + CF_intToStr(i) + ":\n"; for (unsigned long j = 0; j < processors[i].processor_cores.size(); j++) { processors_string += " Core " + CF_intToStr(j) + ":\n"; processors_string += " nb_hardware_thread: " + CF_intToStr(processors[i].processor_cores[j].nb_hardware_thread) + "\n"; for (unsigned long k = 0; k < processors[i].processor_cores[j].nb_hardware_thread; k++) { processors_string += " hardware_thread_load_average: " + CF_intToStr(processors[i].processor_cores[j].hardware_thread_load_averages[k]) + "\n"; processors_string += " previous_hardware_thread_idle_cputime: " + CF_intToStr(processors[i].processor_cores[j].previous_hardware_thread_idle_cputimes[k]) + "\n"; processors_string += " previous_hardware_thread_total_cputime: " + CF_intToStr(processors[i].processor_cores[j].previous_hardware_thread_total_cputimes[k]) + "\n"; } processors_string += " associated_cache_memory: " + CF_boolToStr(processors[i].processor_cores[j].associated_cache_memory) + "\n"; processors_string += " cache_memory_size: " + CF_intToStr(processors[i].processor_cores[j].cache_memory_size) + "\n"; processors_string += " current_freq: " + CF_intToStr(processors[i].processor_cores[j].current_freq) + "\n"; processors_string += " load_average: " + CF_intToStr(processors[i].processor_cores[j].load_average) + "\n"; } processors_string += " associated_cache_memory: " + CF_boolToStr(processors[i].associated_cache_memory) + "\n"; processors_string += " cache_memory_size: " + CF_intToStr(processors[i].cache_memory_size) + "\n"; processors_string += " family: " + CF_intToStr(processors[i].family) + "\n"; processors_string += " model: " + CF_intToStr(processors[i].model) + "\n"; processors_string += " stepping: " + CF_intToStr(processors[i].stepping) + "\n"; processors_string += " architecture: " + processors[i].architecture + "\n"; processors_string += " vendor: " + processors[i].vendor + "\n"; processors_string += " name: " + processors[i].name + "\n"; processors_string += " physical_address_size: " + CF_intToStr(processors[i].physical_address_size) + "\n"; processors_string += " virtual_address_size: " + CF_intToStr(processors[i].virtual_address_size) + "\n"; processors_string += " load_average: " + CF_intToStr(processors[i].load_average) + "\n"; } _L_; return processors_string; } void CPU_setCoreToDefault(_processor_core& processor_core) { _E_; processor_core.nb_hardware_thread = 1; processor_core.hardware_thread_load_averages.clear(); processor_core.previous_hardware_thread_idle_cputimes.clear(); processor_core.previous_hardware_thread_total_cputimes.clear(); processor_core.associated_cache_memory = false; // by default cache is associated with the processor processor_core.cache_memory_size = 0; processor_core.current_freq = 0; processor_core.load_average = 0; _L_; } void CPU_setTopologyToDefault(_processor_topology& processor_topology) { _E_; processor_topology.processor_cores.clear(); processor_topology.associated_cache_memory = true; // by default cache is associated with the processor processor_topology.cache_memory_size = 0; processor_topology.family = 0; processor_topology.model = 0; processor_topology.stepping = 0; processor_topology.architecture = ""; processor_topology.vendor = ""; processor_topology.name = ""; processor_topology.physical_address_size = 0; processor_topology.virtual_address_size = 0; processor_topology.load_average = 0; _L_; } void CPU_findProcessorArchitecture(_processor_topology& topology) { _E_; if (topology.vendor == "AuthenticAMD") { for (unsigned long i = 0; i < sizeof(_AuthenticAMD_Processors)/sizeof(_AuthenticAMD_Processors[0]); i++) { if (topology.family == atoi(_AuthenticAMD_Processors[i][0]) && topology.model == atoi(_AuthenticAMD_Processors[i][1]) && topology.stepping == atoi(_AuthenticAMD_Processors[i][2])) { topology.architecture = _AuthenticAMD_Processors[i][3]; if (_AuthenticAMD_Processors[i][4] == "shared") topology.associated_cache_memory = false; break; } } } if (topology.vendor == "GenuineIntel") { for (unsigned long i = 0; i < sizeof(_GenuineIntel_CPUs)/sizeof(_GenuineIntel_CPUs[0]); i++) { if (topology.family == atoi(_GenuineIntel_CPUs[i][0]) && topology.model == atoi(_GenuineIntel_CPUs[i][1]) && topology.stepping == atoi(_GenuineIntel_CPUs[i][2])) { topology.architecture = _GenuineIntel_CPUs[i][3]; if (_GenuineIntel_CPUs[i][4] == "shared") topology.associated_cache_memory = false; break; } } } _L_; } int CPU_getProcessors(const string& cpuinfo_path, vector<_processor_topology>& processors, string& errorMessage) { _E_; processors.clear(); vector cpuinfo_lines; string stdOut, stdErr; // read the cpu information CF_assert(CF_readTextFileToLines(cpuinfo_path, cpuinfo_lines, 0, errorMessage)); unsigned long nb_core_per_processor = 1; unsigned long nb_hardware_thread_per_core = 1; long nb_core_to_go = -1; long nb_thread_to_go = -1; unsigned long siblings = 1; unsigned long long cache = 0; _processor_topology current_topology; _processor_core current_core; CPU_setTopologyToDefault(current_topology); // guessing what the architecture is // Note: you can install a 32 bit system on a 64 bit architecture which means this info is not reliable #if defined(INTEL) current_topology.architecture = "x86"; #elif defined (X86_64) current_topology.architecture = "x86_64"; #elif defined (IA64) current_topology.architecture = "ia64"; #elif defined (S390) current_topology.architecture = "s390"; #elif defined (PPC) current_topology.architecture = "ppc"; #elif defined (GENERIC) current_topology.architecture = "generic"; #endif CPU_setCoreToDefault(current_core); // for each line of the cpuinfo file for (unsigned long i=0; i < cpuinfo_lines.size(); i++) { // skip empty lines if (cpuinfo_lines[i].size() == 0) continue; // split the line vector cpuinfo_line; CF_splitTextBySpace(cpuinfo_line, CF_untab(cpuinfo_lines[i])); // who knows... if (cpuinfo_line.size() < 2) continue; // found a processor declaration if (cpuinfo_line[0] == "processor") { if (nb_thread_to_go == 0) { // add a core to the topology if (!current_topology.associated_cache_memory) { current_core.associated_cache_memory = true; current_core.cache_memory_size = cache / nb_core_per_processor; } current_core.nb_hardware_thread = nb_hardware_thread_per_core; for (unsigned int j = 0; j < nb_hardware_thread_per_core; j++) { current_core.hardware_thread_load_averages.push_back(0); current_core.previous_hardware_thread_idle_cputimes.push_back(1); current_core.previous_hardware_thread_total_cputimes.push_back(1); } current_topology.processor_cores.push_back(current_core); CPU_setCoreToDefault(current_core); } if (nb_core_to_go == 0 && nb_thread_to_go == 0) { // we're done for this processor if (current_topology.associated_cache_memory) current_topology.cache_memory_size = cache; processors.push_back(current_topology); // reset the processor CPU_setTopologyToDefault(current_topology); nb_core_per_processor = 1; nb_hardware_thread_per_core = 1; nb_core_to_go = -1; nb_thread_to_go = -1; continue; } // go to the next hardware thread if (nb_thread_to_go > 0) { nb_thread_to_go--; continue; } // go to the next core if (nb_thread_to_go == 0 && nb_core_to_go > 0) { nb_thread_to_go = nb_hardware_thread_per_core - 1; nb_core_to_go--; continue; } } // vendor_id if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "vendor_id") { if (cpuinfo_line.size() < 3) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_topology.vendor = cpuinfo_line[2]; continue; } // cpu family if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "cpu" && cpuinfo_line[1] == "family") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_topology.family = atoi(cpuinfo_line[3].c_str()); continue; } // model if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "model" && cpuinfo_line[1] == ":") { if (cpuinfo_line.size() < 3) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_topology.model = atoi(cpuinfo_line[2].c_str()); continue; } // model name if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "model" && cpuinfo_line[1] == "name") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } for (unsigned int j = 3; j < cpuinfo_line.size(); j++) { current_topology.name += cpuinfo_line[j]; if (j < cpuinfo_line.size() - 1) current_topology.name += " "; } continue; } // stepping if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "stepping") { if (cpuinfo_line.size() < 3) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_topology.stepping = atoi(cpuinfo_line[2].c_str()); // we know which processor it is so let's try to find it in our own list CPU_findProcessorArchitecture(current_topology); continue; } // cpu MHz if (cpuinfo_line[0] == "cpu" && cpuinfo_line[1] == "MHz") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_core.current_freq = atof(cpuinfo_line[3].c_str())*1000; continue; } // cache size if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "cache" && cpuinfo_line[1] == "size") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } cache = atoll(cpuinfo_line[3].c_str()); continue; } // siblings if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "siblings") { if (cpuinfo_line.size() < 3) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } siblings = atol(cpuinfo_line[2].c_str()); continue; } // cpu cores if (nb_core_to_go == -1 && nb_thread_to_go ==-1 && cpuinfo_line[0] == "cpu" && cpuinfo_line[1] == "cores") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } // information for the current processor (first time we read it... and last) nb_core_per_processor = atol(cpuinfo_line[3].c_str()); nb_hardware_thread_per_core = siblings / nb_core_per_processor; // set the number of cores and hardware threads we should read next nb_core_to_go = nb_core_per_processor - 1; nb_thread_to_go = nb_hardware_thread_per_core - 1; continue; } // address sizes if (nb_core_to_go == nb_core_per_processor - 1 && nb_thread_to_go == nb_hardware_thread_per_core - 1 && cpuinfo_line[0] == "address" && cpuinfo_line[1] == "sizes") { if (cpuinfo_line.size() < 4) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } string rest_of_the_line; for (unsigned int j = 3; j < cpuinfo_line.size(); j++) { rest_of_the_line += cpuinfo_line[j]; if (j < cpuinfo_line.size()-1) rest_of_the_line += " "; } vector rest_of_the_line_elements; CF_splitText(rest_of_the_line_elements, rest_of_the_line, ','); if (rest_of_the_line_elements.size() < 2) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } vector rest_of_the_line_left_element, rest_of_the_line_right_element; CF_splitTextBySpace(rest_of_the_line_left_element, rest_of_the_line_elements[0]); CF_splitTextBySpace(rest_of_the_line_right_element, rest_of_the_line_elements[1]); if (rest_of_the_line_left_element.size() != 3 || rest_of_the_line_right_element.size() != 3) { errorMessage = "Wrong format (at line " + CF_intToStr(i) + "): " + (string) cpuinfo_path; return FAILED; } current_topology.physical_address_size = atoi(rest_of_the_line_left_element[0].c_str()); current_topology.virtual_address_size = atoi(rest_of_the_line_right_element[0].c_str()); continue; } } // the last core if (!current_topology.associated_cache_memory) { current_core.associated_cache_memory = true; current_core.cache_memory_size = cache / nb_core_per_processor; } current_core.nb_hardware_thread = nb_hardware_thread_per_core; for (unsigned int j = 0; j < nb_hardware_thread_per_core; j++) { current_core.hardware_thread_load_averages.push_back(0); current_core.previous_hardware_thread_idle_cputimes.push_back(1); current_core.previous_hardware_thread_total_cputimes.push_back(1); } current_topology.processor_cores.push_back(current_core); // the last processor if (current_topology.associated_cache_memory) current_topology.cache_memory_size = cache; processors.push_back(current_topology); _L_; return OK; } int CPU_getLoadAverages(vector<_processor_topology>& new_processors, const vector<_processor_topology>& old_processors, string& errorMessage) { _E_; vector proc_stat_lines; // read the cpu information CF_assert(CF_readTextFileToLines("/proc/stat", proc_stat_lines, 0, errorMessage)); unsigned int line_index = 1; for (unsigned int i = 0; i < new_processors.size(); i++) { for (unsigned int j = 0; j < new_processors[i].processor_cores.size(); j++) { for (unsigned int k = 0; k < new_processors[i].processor_cores[j].nb_hardware_thread; k++) { if (line_index >= proc_stat_lines.size()) { errorMessage = "Wrong format (not enough lines): /proc/stat"; return FAILED; } vector proc_stat_line; CF_splitTextBySpace(proc_stat_line, proc_stat_lines[line_index]); // /proc/stat cputime info line should contain at least 8 elemens if (proc_stat_line.size() < 8) { errorMessage = "Wrong format (at line " + CF_intToStr(line_index+1) + "): /proc/stat"; return FAILED; } // get fresh idle and total unsigned long long idle = CF_strToULL(proc_stat_line[4]); unsigned long long total = 0; for (unsigned int l = 1; l < proc_stat_line.size(); l++) { total += CF_strToULL(proc_stat_line[l]); } unsigned long long delta_idle = idle - old_processors[i].processor_cores[j].previous_hardware_thread_idle_cputimes[k]; unsigned long long delta_total = total - old_processors[i].processor_cores[j].previous_hardware_thread_total_cputimes[k]; // compute the new load average for this hardware thread if (delta_total != 0) new_processors[i].processor_cores[j].hardware_thread_load_averages[k] = (unsigned short) ((delta_total - delta_idle)*100/delta_total); else { if (delta_total - delta_idle == 0) new_processors[i].processor_cores[j].hardware_thread_load_averages[k] = 0; else new_processors[i].processor_cores[j].hardware_thread_load_averages[k] = 100; } // set the fresh idle and total new_processors[i].processor_cores[j].previous_hardware_thread_idle_cputimes[k] = idle; new_processors[i].processor_cores[j].previous_hardware_thread_total_cputimes[k] = total; line_index++; } unsigned long long load_average = 0; for (unsigned int k = 0; k < new_processors[i].processor_cores[j].nb_hardware_thread; k++) load_average += new_processors[i].processor_cores[j].hardware_thread_load_averages[k]; new_processors[i].processor_cores[j].load_average = (load_average/(new_processors[i].processor_cores[j].nb_hardware_thread)); } unsigned long long load_average = 0; for (unsigned int j = 0; j < new_processors[i].processor_cores.size(); j++) load_average += new_processors[i].processor_cores[j].load_average; new_processors[i].load_average = (load_average/(new_processors[i].processor_cores.size())); } _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/configure.ac0000644000175000017500000001274011401065455021531 0ustar guillaumeguillaume# Process this file with autoconf to produce a configure script. ################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ AC_PREREQ(2.59) AC_COPYRIGHT([[############################################################################### Note: This Copyright statement covers the OpenDRIM original parts of this file. It does NOT concern the parts generated by autoconf. Linux Management Providers (LMP), Sensors provider package Copyright (C) 2009 Shakhrom RUSTAMOV This program is being developed under the "OpenDRIM" project. The "OpenDRIM" project web page: http://opendrim.sourceforge.net The "OpenDRIM" project mailing list: opendrim@googlegroups.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public 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(Sensors 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_AssociatedProcessorVoltageSensor/Makefile OpenDRIM_SensorConformsToProfile/Makefile OpenDRIM_SensorCapabilities/Makefile OpenDRIM_BatteryTempratureSensor/Makefile OpenDRIM_ComputerSystemSensor/Makefile OpenDRIM_Sensor/Makefile OpenDRIM_RegisteredSensorsProfile/Makefile OpenDRIM_ProcessorVoltageSensor/Makefile OpenDRIM_AssociatedBatterySensor/Makefile OpenDRIM_NumericSensor/Makefile OpenDRIM_AssociatedSensor/Makefile OpenDRIM_EnabledSensorCapabilities/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-sensors-1.0.0~ppa/TODO0000644000175000017500000000010111401065455017717 0ustar guillaumeguillaumeTODO for Major.Minor.Revision ========================= // TODO opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/0000755000175000017500000000000011401065455025732 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/cmpiOpenDRIM_EnabledSensorCapabilities.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/cmpiOpenDRIM_EnabledSensorCapabili0000644000175000017500000000442511401065455034341 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_ENABLEDSENSORCAPABILITIES_H_ #define CMPIOPENDRIM_ENABLEDSENSORCAPABILITIES_H_ #include "OpenDRIM_EnabledSensorCapabilities.h" CMPIObjectPath* Sensors_OpenDRIM_EnabledSensorCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_EnabledSensorCapabilities& instance); CMPIInstance* Sensors_OpenDRIM_EnabledSensorCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_EnabledSensorCapabilities& instance); void Sensors_OpenDRIM_EnabledSensorCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_EnabledSensorCapabilities& instance); void Sensors_OpenDRIM_EnabledSensorCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_EnabledSensorCapabilities& instance); #endif /*CMPIOPENDRIM_ENABLEDSENSORCAPABILITIES_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/Makefile.am0000644000175000017500000000416111401065455027770 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_EnabledSensorCapabilitiesProvider.la libcmpiSensors_OpenDRIM_EnabledSensorCapabilitiesProvider_la_SOURCES = OpenDRIM_EnabledSensorCapabilitiesAccess.cpp OpenDRIM_EnabledSensorCapabilitiesProvider.cpp cmpiOpenDRIM_EnabledSensorCapabilities.cpp libcmpiSensors_OpenDRIM_EnabledSensorCapabilitiesProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la libcmpiSensors_OpenDRIM_EnabledSensorCapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_EnabledSensorCapabilities.h OpenDRIM_EnabledSensorCapabilities.h OpenDRIM_EnabledSensorCapabilitiesAccess.h ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/OpenDRIM_EnabledSensorCapabilitiesAccess.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/OpenDRIM_EnabledSensorCapabilities0000644000175000017500000000626511401065455034361 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_EnabledSensorCapabilitiesAccess.h" int Sensors_OpenDRIM_EnabledSensorCapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_EnabledSensorCapabilities_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_EnabledSensorCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return OK; } int Sensors_OpenDRIM_EnabledSensorCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_EnabledSensorCapabilities& instance, const char** properties, string& errorMessage) { _E_; _L_; return OK; } int Sensors_OpenDRIM_EnabledSensorCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledSensorCapabilities& newInstance, const OpenDRIM_EnabledSensorCapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_EnabledSensorCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledSensorCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_EnabledSensorCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledSensorCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_EnabledSensorCapabilities_populate(OpenDRIM_EnabledSensorCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/OpenDRIM_EnabledSensorCapabilitiesAccess.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/OpenDRIM_EnabledSensorCapabilities0000644000175000017500000000610011401065455034345 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ENABLEDSENSORCAPABILITIESACCESS_H_ #define OPENDRIM_ENABLEDSENSORCAPABILITIESACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_EnabledSensorCapabilities.h" int Sensors_OpenDRIM_EnabledSensorCapabilities_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_EnabledSensorCapabilities_unload(string& errorMessage); int Sensors_OpenDRIM_EnabledSensorCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_EnabledSensorCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_EnabledSensorCapabilities& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_EnabledSensorCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledSensorCapabilities& newInstance, const OpenDRIM_EnabledSensorCapabilities& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_EnabledSensorCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledSensorCapabilities& instance, string& errorMessage); int Sensors_OpenDRIM_EnabledSensorCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledSensorCapabilities& instance, string& errorMessage); int Sensors_OpenDRIM_EnabledSensorCapabilities_populate(OpenDRIM_EnabledSensorCapabilities& instance, string& errorMessage); #endif /*OPENDRIM_ENABLEDSENSORCAPABILITIESACCESS_H_*/ ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/OpenDRIM_EnabledSensorCapabilitiesProvider.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/OpenDRIM_EnabledSensorCapabilities0000644000175000017500000002646111401065455034361 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_EnabledSensorCapabilities.h" #include "OpenDRIM_EnabledSensorCapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_EnabledSensorCapabilitiesProviderSetInstance Sensors_OpenDRIM_EnabledSensorCapabilitiesProviderModifyInstance #endif int Sensors_OpenDRIM_EnabledSensorCapabilities_init(const CMPIBroker* broker); int Sensors_OpenDRIM_EnabledSensorCapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_EnabledSensorCapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_EnabledSensorCapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_EnabledSensorCapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_EnabledSensorCapabilitiesProviderEnumInstances(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 = Sensors_OpenDRIM_EnabledSensorCapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_EnabledSensorCapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_EnabledSensorCapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledSensorCapabilities instance; Sensors_OpenDRIM_EnabledSensorCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_EnabledSensorCapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_EnabledSensorCapabilitiesProviderSetInstance(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_EnabledSensorCapabilities newInstance, oldInstance; Sensors_OpenDRIM_EnabledSensorCapabilities_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_EnabledSensorCapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_EnabledSensorCapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledSensorCapabilities instance; Sensors_OpenDRIM_EnabledSensorCapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_EnabledSensorCapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_EnabledSensorCapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledSensorCapabilities instance; Sensors_OpenDRIM_EnabledSensorCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_EnabledSensorCapabilitiesProviderExecQuery(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 Sensors_OpenDRIM_EnabledSensorCapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_EnabledSensorCapabilities_init FAILED: " + (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_EnabledSensorCapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_EnabledSensorCapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_EnabledSensorCapabilities_unload FAILED: " + (string) OpenDRIM_EnabledSensorCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_EnabledSensorCapabilities_INIT if (Sensors_OpenDRIM_EnabledSensorCapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_EnabledSensorCapabilitiesProvider, Sensors_OpenDRIM_EnabledSensorCapabilitiesProvider, _broker, Sensors_OpenDRIM_EnabledSensorCapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/OpenDRIM_EnabledSensorCapabilities.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/OpenDRIM_EnabledSensorCapabilities0000644000175000017500000001200511401065455034346 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ENABLEDSENSORCAPABILITIES_H_ #define OPENDRIM_ENABLEDSENSORCAPABILITIES_H_ #include const static char* OpenDRIM_EnabledSensorCapabilities_classnames[] = {"OpenDRIM_EnabledSensorCapabilities"}; static string OpenDRIM_EnabledSensorCapabilities_NAMESPACE = _NAMESPACE; class OpenDRIM_EnabledSensorCapabilities { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string InstanceID; bool InstanceID_isNULL; string ElementName; bool ElementName_isNULL; bool ElementNameEditSupported; bool ElementNameEditSupported_isNULL; unsigned short MaxElementNameLen; bool MaxElementNameLen_isNULL; vector RequestedStatesSupported; bool RequestedStatesSupported_isNULL; string ElementNameMask; bool ElementNameMask_isNULL; OpenDRIM_EnabledSensorCapabilities() { Caption_isNULL = true; Description_isNULL = true; InstanceID_isNULL = true; ElementName_isNULL = true; ElementNameEditSupported_isNULL = true; MaxElementNameLen_isNULL = true; RequestedStatesSupported_isNULL = true; ElementNameMask_isNULL = true; } ~OpenDRIM_EnabledSensorCapabilities() {} string getKeys() const { return CF_toLowCase(".InstanceID=\"" + CF_quoteString(InstanceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getElementNameEditSupported(bool& value) const { if (ElementNameEditSupported_isNULL==true) return NOT_FOUND; value = ElementNameEditSupported; return OK; } int setElementNameEditSupported(const bool& newValue) { ElementNameEditSupported = newValue; ElementNameEditSupported_isNULL = false; return OK; } int getMaxElementNameLen(unsigned short& value) const { if (MaxElementNameLen_isNULL==true) return NOT_FOUND; value = MaxElementNameLen; return OK; } int setMaxElementNameLen(const unsigned short& newValue) { MaxElementNameLen = newValue; MaxElementNameLen_isNULL = false; return OK; } int getRequestedStatesSupported(vector& value) const { if (RequestedStatesSupported_isNULL==true) return NOT_FOUND; value = RequestedStatesSupported; return OK; } int setRequestedStatesSupported(const vector& newValue) { RequestedStatesSupported = newValue; RequestedStatesSupported_isNULL = false; return OK; } int getElementNameMask(string& value) const { if (ElementNameMask_isNULL==true) return NOT_FOUND; value = ElementNameMask; return OK; } int setElementNameMask(const string& newValue) { ElementNameMask = newValue; ElementNameMask_isNULL = false; return OK; } }; #endif /*OPENDRIM_ENABLEDSENSORCAPABILITIES_H_*/ ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/cmpiOpenDRIM_EnabledSensorCapabilities.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_EnabledSensorCapabilities/cmpiOpenDRIM_EnabledSensorCapabili0000644000175000017500000001057111401065455034340 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_EnabledSensorCapabilities.h" CMPIObjectPath* Sensors_OpenDRIM_EnabledSensorCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_EnabledSensorCapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_EnabledSensorCapabilities_classnames[0], OpenDRIM_EnabledSensorCapabilities_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_EnabledSensorCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_EnabledSensorCapabilities& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_EnabledSensorCapabilities_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.ElementNameEditSupported_isNULL) ci.setProperty("ElementNameEditSupported", instance.ElementNameEditSupported); if (!instance.MaxElementNameLen_isNULL) ci.setProperty("MaxElementNameLen", instance.MaxElementNameLen); if (!instance.RequestedStatesSupported_isNULL) ci.setProperty("RequestedStatesSupported", instance.RequestedStatesSupported); if (!instance.ElementNameMask_isNULL) ci.setProperty("ElementNameMask", instance.ElementNameMask); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_EnabledSensorCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_EnabledSensorCapabilities& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void Sensors_OpenDRIM_EnabledSensorCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_EnabledSensorCapabilities& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("ElementNameEditSupported", instance.ElementNameEditSupported) == OK) instance.ElementNameEditSupported_isNULL = false; if (inst.getProperty("MaxElementNameLen", instance.MaxElementNameLen) == OK) instance.MaxElementNameLen_isNULL = false; if (inst.getProperty("RequestedStatesSupported", instance.RequestedStatesSupported) == OK) instance.RequestedStatesSupported_isNULL = false; if (inst.getProperty("ElementNameMask", instance.ElementNameMask) == OK) instance.ElementNameMask_isNULL = false; _L_; } opendrim-lmp-sensors-1.0.0~ppa/INSTALL0000644000175000017500000000370211401065455020272 0ustar guillaumeguillaume --------------------------------------------------------- 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-sensors-1.0.0~ppa/AUTHORS0000644000175000017500000000012711401065455020307 0ustar guillaumeguillaumeShakhrom RUSTAMOV Guillaume BOTTEX opendrim-lmp-sensors-1.0.0~ppa/packaging/0000755000175000017500000000000011401065455021163 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/packaging/debian/0000755000175000017500000000000011404351236022403 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/packaging/debian/postrm0000644000175000017500000000336711404351236023663 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_AssociatedProcessorVoltageSensor rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SensorConformsToProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SensorCapabilities rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_BatteryTempratureSensor rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ComputerSystemSensor rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_Sensor rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_RegisteredSensorsProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ProcessorVoltageSensor rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_AssociatedBatterySensor rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_NumericSensor rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_AssociatedSensor rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_EnabledSensorCapabilities ;; 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-sensors-1.0.0~ppa/packaging/debian/source/0000755000175000017500000000000011401065455023705 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/packaging/debian/source/format0000644000175000017500000000001411401065455025113 0ustar guillaumeguillaume3.0 (quilt) opendrim-lmp-sensors-1.0.0~ppa/packaging/debian/copyright0000644000175000017500000000276111401065455024346 0ustar guillaumeguillaumeThis package was debianized by Guillaume BOTTEX on Wed, 9 Dec 2009 15:09:40 +0900. It was downloaded from http://opendrim.sourceforge.net/ Upstream Authors: Shakhrom RUSTAMOV Guillaume BOTTEX Copyright: Copyright (C) 2009 ETRI Shakhrom RUSTAMOV Copyright (C) 2009 ETRI Guillaume BOTTEX License: Linux Management Providers (LMP), Sensors provider package This program is being developed under the "OpenDRIM" project. The "OpenDRIM" project web page: http://opendrim.sourceforge.net The "OpenDRIM" project mailing list: opendrim@googlegroups.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. The Debian packaging is copyright 2009, Guillaume BOTTEX and is licensed under the GPL, see `/usr/share/common-licenses/GPL-2'. opendrim-lmp-sensors-1.0.0~ppa/packaging/debian/control0000644000175000017500000000124511404351230024002 0ustar guillaumeguillaumeSource: opendrim-lmp-sensors 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-sensors Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, sfcb, libopendrim0 (>= 1.1.3) Description: OpenDRIM Sensors provider Provides information about the computer system sensors capabilities. . Compliant with the DMTF Sensors Profile v1.0.2 (DSP1009). opendrim-lmp-sensors-1.0.0~ppa/packaging/debian/prerm0000644000175000017500000000242111401065455023454 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-sensors VERSION=`cat /usr/share/doc/opendrim-lmp-sensors/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=Sensors $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-sensors-1.0.0~ppa/packaging/debian/changelog0000644000175000017500000000024511404351215024253 0ustar guillaumeguillaumeopendrim-lmp-sensors (1.0.0-0ubuntu1) lucid; urgency=low * Initial release -- Guillaume BOTTEX Fri, 11 Jun 2010 15:07:00 +0900 opendrim-lmp-sensors-1.0.0~ppa/packaging/debian/postinst0000644000175000017500000000257611401065455024225 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-sensors VERSION=`cat /usr/share/doc/opendrim-lmp-sensors/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=Sensors $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-sensors-1.0.0~ppa/packaging/debian/install0000644000175000017500000000004711401065455023777 0ustar guillaumeguillaumeusr/lib/cmpi/*.so usr/share/OpenDRIM/* opendrim-lmp-sensors-1.0.0~ppa/packaging/debian/rules0000755000175000017500000000354711401065455023476 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-sensors 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-sensors.sgml > opendrim-lmp-sensors.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-sensors-1.0.0~ppa/packaging/debian/docs0000644000175000017500000000003111401065455023252 0ustar guillaumeguillaumeNEWS README TODO VERSION opendrim-lmp-sensors-1.0.0~ppa/packaging/debian/compat0000644000175000017500000000000211401065455023603 0ustar guillaumeguillaume5 opendrim-lmp-sensors-1.0.0~ppa/packaging/opendrim-lmp-sensors.spec0000644000175000017500000000517411401065455026143 0ustar guillaumeguillaume#%///////////////////////////////////////////////////////////////////////////// # # Sensors RPM spec file # #%///////////////////////////////////////////////////////////////////////////// %define packageVersion 1 Version: %{version} Release: %{packageVersion}%{?dist} Vendor: OpenDRIM Summary: OpenDRIM Sensors Provider Name: opendrim-lmp-sensors 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 Sensors %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-sensors-1.0.0~ppa/mof/0000755000175000017500000000000011401065455020020 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_Sensor.mof0000644000175000017500000000314011401065455023427 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiSensors_OpenDRIM_SensorProvider")] class OpenDRIM_Sensor:CIM_Sensor { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_BatteryTempratureSensor.mof0000644000175000017500000000320211401065455027032 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiSensors_OpenDRIM_BatteryTempratureSensorProvider")] class OpenDRIM_BatteryTempratureSensor:CIM_Sensor { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_SensorCapabilities.mof0000644000175000017500000000322311401065455025743 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiSensors_OpenDRIM_SensorCapabilitiesProvider")] class OpenDRIM_SensorCapabilities:CIM_ElementCapabilities { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_RegisteredSensorsProfile.mof0000644000175000017500000000321711401065455027156 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiSensors_OpenDRIM_RegisteredSensorsProfileProvider")] class OpenDRIM_RegisteredSensorsProfile:CIM_RegisteredProfile { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_ComputerSystemSensor.mof0000644000175000017500000000322011401065455026352 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiSensors_OpenDRIM_ComputerSystemSensorProvider")] class OpenDRIM_ComputerSystemSensor:CIM_SystemDevice { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_SensorConformsToProfile.mof0000644000175000017500000000324211401065455026765 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiSensors_OpenDRIM_SensorConformsToProfileProvider")] class OpenDRIM_SensorConformsToProfile:CIM_ElementConformsToProfile { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_AssociatedProcessorVoltageSensor.mof0000644000175000017500000000325411401065455030657 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiSensors_OpenDRIM_AssociatedProcessorVoltageSensorProvider")] class OpenDRIM_AssociatedProcessorVoltageSensor:CIM_AssociatedSensor { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_AssociatedBatterySensor.mof0000644000175000017500000000323211401065455026764 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiSensors_OpenDRIM_AssociatedBatterySensorProvider")] class OpenDRIM_AssociatedBatterySensor:CIM_AssociatedSensor { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_NumericSensor.mof0000644000175000017500000000316511401065455024761 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiSensors_OpenDRIM_NumericSensorProvider")] class OpenDRIM_NumericSensor:CIM_NumericSensor { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_ProcessorVoltageSensor.mof0000644000175000017500000000320711401065455026655 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiSensors_OpenDRIM_ProcessorVoltageSensorProvider")] class OpenDRIM_ProcessorVoltageSensor:CIM_NumericSensor { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_AssociatedSensor.mof0000644000175000017500000000321411401065455025431 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Association, Provider("cmpi:cmpiSensors_OpenDRIM_AssociatedSensorProvider")] class OpenDRIM_AssociatedSensor:CIM_AssociatedSensor { }; opendrim-lmp-sensors-1.0.0~ppa/mof/OpenDRIM_EnabledSensorCapabilities.mof0000644000175000017500000000324111401065455027216 0ustar guillaumeguillaume//################################################################################ // Linux Management Providers (LMP), Sensors provider package // Copyright (C) 2009 Shakhrom RUSTAMOV // // This program is being developed under the "OpenDRIM" project. // The "OpenDRIM" project web page: http://opendrim.sourceforge.net // The "OpenDRIM" project mailing list: opendrim@googlegroups.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //################################################################################ //################################################################################ // To contributors, please leave your contact information in this section // AND comment your changes in the source code. // // Modified by 2009 Guillaume BOTTEX, ETRI //################################################################################ [Provider("cmpi:cmpiSensors_OpenDRIM_EnabledSensorCapabilitiesProvider")] class OpenDRIM_EnabledSensorCapabilities:CIM_EnabledLogicalElementCapabilities { }; opendrim-lmp-sensors-1.0.0~ppa/COPYING0000644000175000017500000004310311401065455020273 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-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/0000755000175000017500000000000011401065455025667 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/OpenDRIM_RegisteredSensorsProfileAccess.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/OpenDRIM_RegisteredSensorsProfileAc0000644000175000017500000000605511401065455034514 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDSENSORSPROFILEACCESS_H_ #define OPENDRIM_REGISTEREDSENSORSPROFILEACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_RegisteredSensorsProfile.h" int Sensors_OpenDRIM_RegisteredSensorsProfile_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_RegisteredSensorsProfile_unload(string& errorMessage); int Sensors_OpenDRIM_RegisteredSensorsProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_RegisteredSensorsProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredSensorsProfile& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_RegisteredSensorsProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSensorsProfile& newInstance, const OpenDRIM_RegisteredSensorsProfile& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_RegisteredSensorsProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSensorsProfile& instance, string& errorMessage); int Sensors_OpenDRIM_RegisteredSensorsProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSensorsProfile& instance, string& errorMessage); int Sensors_OpenDRIM_RegisteredSensorsProfile_populate(OpenDRIM_RegisteredSensorsProfile& instance, string& errorMessage); #endif /*OPENDRIM_REGISTEREDSENSORSPROFILEACCESS_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/Makefile.am0000644000175000017500000000414711401065455027731 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_RegisteredSensorsProfileProvider.la libcmpiSensors_OpenDRIM_RegisteredSensorsProfileProvider_la_SOURCES = OpenDRIM_RegisteredSensorsProfileAccess.cpp OpenDRIM_RegisteredSensorsProfileProvider.cpp cmpiOpenDRIM_RegisteredSensorsProfile.cpp libcmpiSensors_OpenDRIM_RegisteredSensorsProfileProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la libcmpiSensors_OpenDRIM_RegisteredSensorsProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_RegisteredSensorsProfile.h OpenDRIM_RegisteredSensorsProfile.h OpenDRIM_RegisteredSensorsProfileAccess.h ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/OpenDRIM_RegisteredSensorsProfile.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/OpenDRIM_RegisteredSensorsProfile.h0000644000175000017500000001352711401065455034500 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDSENSORSPROFILE_H_ #define OPENDRIM_REGISTEREDSENSORSPROFILE_H_ #include const static char* OpenDRIM_RegisteredSensorsProfile_classnames[] = {"OpenDRIM_RegisteredSensorsProfile"}; static string OpenDRIM_RegisteredSensorsProfile_NAMESPACE = _INTEROP_NAMESPACE; class OpenDRIM_RegisteredSensorsProfile { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstanceID; bool InstanceID_isNULL; unsigned short RegisteredOrganization; bool RegisteredOrganization_isNULL; string OtherRegisteredOrganization; bool OtherRegisteredOrganization_isNULL; string RegisteredName; bool RegisteredName_isNULL; string RegisteredVersion; bool RegisteredVersion_isNULL; vector AdvertiseTypes; bool AdvertiseTypes_isNULL; vector AdvertiseTypeDescriptions; bool AdvertiseTypeDescriptions_isNULL; OpenDRIM_RegisteredSensorsProfile() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstanceID_isNULL = true; RegisteredOrganization_isNULL = true; OtherRegisteredOrganization_isNULL = true; RegisteredName_isNULL = true; RegisteredVersion_isNULL = true; AdvertiseTypes_isNULL = true; AdvertiseTypeDescriptions_isNULL = true; } ~OpenDRIM_RegisteredSensorsProfile() {} string getKeys() const { return CF_toLowCase(".InstanceID=\"" + CF_quoteString(InstanceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getRegisteredOrganization(unsigned short& value) const { if (RegisteredOrganization_isNULL==true) return NOT_FOUND; value = RegisteredOrganization; return OK; } int setRegisteredOrganization(const unsigned short& newValue) { RegisteredOrganization = newValue; RegisteredOrganization_isNULL = false; return OK; } int getOtherRegisteredOrganization(string& value) const { if (OtherRegisteredOrganization_isNULL==true) return NOT_FOUND; value = OtherRegisteredOrganization; return OK; } int setOtherRegisteredOrganization(const string& newValue) { OtherRegisteredOrganization = newValue; OtherRegisteredOrganization_isNULL = false; return OK; } int getRegisteredName(string& value) const { if (RegisteredName_isNULL==true) return NOT_FOUND; value = RegisteredName; return OK; } int setRegisteredName(const string& newValue) { RegisteredName = newValue; RegisteredName_isNULL = false; return OK; } int getRegisteredVersion(string& value) const { if (RegisteredVersion_isNULL==true) return NOT_FOUND; value = RegisteredVersion; return OK; } int setRegisteredVersion(const string& newValue) { RegisteredVersion = newValue; RegisteredVersion_isNULL = false; return OK; } int getAdvertiseTypes(vector& value) const { if (AdvertiseTypes_isNULL==true) return NOT_FOUND; value = AdvertiseTypes; return OK; } int setAdvertiseTypes(const vector& newValue) { AdvertiseTypes = newValue; AdvertiseTypes_isNULL = false; return OK; } int getAdvertiseTypeDescriptions(vector& value) const { if (AdvertiseTypeDescriptions_isNULL==true) return NOT_FOUND; value = AdvertiseTypeDescriptions; return OK; } int setAdvertiseTypeDescriptions(const vector& newValue) { AdvertiseTypeDescriptions = newValue; AdvertiseTypeDescriptions_isNULL = false; return OK; } }; #endif /*OPENDRIM_REGISTEREDSENSORSPROFILE_H_*/ ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/cmpiOpenDRIM_RegisteredSensorsProfile.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/cmpiOpenDRIM_RegisteredSensorsProfi0000644000175000017500000001153511401065455034577 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredSensorsProfile.h" CMPIObjectPath* Sensors_OpenDRIM_RegisteredSensorsProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredSensorsProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_RegisteredSensorsProfile_classnames[0], OpenDRIM_RegisteredSensorsProfile_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_RegisteredSensorsProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredSensorsProfile& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_RegisteredSensorsProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.RegisteredOrganization_isNULL) ci.setProperty("RegisteredOrganization", instance.RegisteredOrganization); if (!instance.OtherRegisteredOrganization_isNULL) ci.setProperty("OtherRegisteredOrganization", instance.OtherRegisteredOrganization); if (!instance.RegisteredName_isNULL) ci.setProperty("RegisteredName", instance.RegisteredName); if (!instance.RegisteredVersion_isNULL) ci.setProperty("RegisteredVersion", instance.RegisteredVersion); if (!instance.AdvertiseTypes_isNULL) ci.setProperty("AdvertiseTypes", instance.AdvertiseTypes); if (!instance.AdvertiseTypeDescriptions_isNULL) ci.setProperty("AdvertiseTypeDescriptions", instance.AdvertiseTypeDescriptions); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_RegisteredSensorsProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredSensorsProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void Sensors_OpenDRIM_RegisteredSensorsProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredSensorsProfile& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("RegisteredOrganization", instance.RegisteredOrganization) == OK) instance.RegisteredOrganization_isNULL = false; if (inst.getProperty("OtherRegisteredOrganization", instance.OtherRegisteredOrganization) == OK) instance.OtherRegisteredOrganization_isNULL = false; if (inst.getProperty("RegisteredName", instance.RegisteredName) == OK) instance.RegisteredName_isNULL = false; if (inst.getProperty("RegisteredVersion", instance.RegisteredVersion) == OK) instance.RegisteredVersion_isNULL = false; if (inst.getProperty("AdvertiseTypes", instance.AdvertiseTypes) == OK) instance.AdvertiseTypes_isNULL = false; if (inst.getProperty("AdvertiseTypeDescriptions", instance.AdvertiseTypeDescriptions) == OK) instance.AdvertiseTypeDescriptions_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/OpenDRIM_RegisteredSensorsProfileProvider.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/OpenDRIM_RegisteredSensorsProfilePr0000644000175000017500000002636211401065455034555 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredSensorsProfile.h" #include "OpenDRIM_RegisteredSensorsProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_RegisteredSensorsProfileProviderSetInstance Sensors_OpenDRIM_RegisteredSensorsProfileProviderModifyInstance #endif int Sensors_OpenDRIM_RegisteredSensorsProfile_init(const CMPIBroker* broker); int Sensors_OpenDRIM_RegisteredSensorsProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_RegisteredSensorsProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_RegisteredSensorsProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_RegisteredSensorsProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_RegisteredSensorsProfileProviderEnumInstances(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 = Sensors_OpenDRIM_RegisteredSensorsProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_RegisteredSensorsProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_RegisteredSensorsProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredSensorsProfile instance; Sensors_OpenDRIM_RegisteredSensorsProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_RegisteredSensorsProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_RegisteredSensorsProfileProviderSetInstance(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_RegisteredSensorsProfile newInstance, oldInstance; Sensors_OpenDRIM_RegisteredSensorsProfile_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_RegisteredSensorsProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_RegisteredSensorsProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredSensorsProfile instance; Sensors_OpenDRIM_RegisteredSensorsProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_RegisteredSensorsProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_RegisteredSensorsProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredSensorsProfile instance; Sensors_OpenDRIM_RegisteredSensorsProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_RegisteredSensorsProfileProviderExecQuery(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 Sensors_OpenDRIM_RegisteredSensorsProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_RegisteredSensorsProfile_init FAILED: " + (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_RegisteredSensorsProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_RegisteredSensorsProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_RegisteredSensorsProfile_unload FAILED: " + (string) OpenDRIM_RegisteredSensorsProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_RegisteredSensorsProfile_INIT if (Sensors_OpenDRIM_RegisteredSensorsProfile_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_RegisteredSensorsProfileProvider, Sensors_OpenDRIM_RegisteredSensorsProfileProvider, _broker, Sensors_OpenDRIM_RegisteredSensorsProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/cmpiOpenDRIM_RegisteredSensorsProfile.hopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/cmpiOpenDRIM_RegisteredSensorsProfi0000644000175000017500000000441111401065455034572 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_REGISTEREDSENSORSPROFILE_H_ #define CMPIOPENDRIM_REGISTEREDSENSORSPROFILE_H_ #include "OpenDRIM_RegisteredSensorsProfile.h" CMPIObjectPath* Sensors_OpenDRIM_RegisteredSensorsProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredSensorsProfile& instance); CMPIInstance* Sensors_OpenDRIM_RegisteredSensorsProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredSensorsProfile& instance); void Sensors_OpenDRIM_RegisteredSensorsProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredSensorsProfile& instance); void Sensors_OpenDRIM_RegisteredSensorsProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredSensorsProfile& instance); #endif /*CMPIOPENDRIM_REGISTEREDSENSORSPROFILE_H_*/ ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/OpenDRIM_RegisteredSensorsProfileAccess.cppopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_RegisteredSensorsProfile/OpenDRIM_RegisteredSensorsProfileAc0000644000175000017500000000756511401065455034523 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_RegisteredSensorsProfileAccess.h" const string InstanceID="OpenDRIM:Sensors:1.0.2"; int Sensors_OpenDRIM_RegisteredSensorsProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_RegisteredSensorsProfile_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_RegisteredSensorsProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_RegisteredSensorsProfile instance; instance.setInstanceID(InstanceID); if(discriminant=="ei") CF_assert(Sensors_OpenDRIM_RegisteredSensorsProfile_populate(instance,errorMessage)); result.push_back(instance); _L_; return OK; } int Sensors_OpenDRIM_RegisteredSensorsProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredSensorsProfile& instance, const char** properties, string& errorMessage) { _E_; if (instance.InstanceID!=InstanceID) { errorMessage = "No instance"; return NOT_FOUND; } CF_assert(Sensors_OpenDRIM_RegisteredSensorsProfile_populate(instance,errorMessage)); _L_; return OK; } int Sensors_OpenDRIM_RegisteredSensorsProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSensorsProfile& newInstance, const OpenDRIM_RegisteredSensorsProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_RegisteredSensorsProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSensorsProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_RegisteredSensorsProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredSensorsProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_RegisteredSensorsProfile_populate(OpenDRIM_RegisteredSensorsProfile& instance, string& errorMessage) { _E_; vector AdvertiseTypes; instance.setRegisteredName("Sensors"); instance.setRegisteredVersion("1.0.2"); instance.setRegisteredOrganization(2); // DMTF AdvertiseTypes.push_back(2); // Not Advertised instance.setAdvertiseTypes(AdvertiseTypes); _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/NEWS0000644000175000017500000000017511401065455017741 0ustar guillaumeguillaumeInitial Release 1.0.0 ========================= // TODO Changes in Major.Minor.Revision ========================= // TODO opendrim-lmp-sensors-1.0.0~ppa/LICENSE0000644000175000017500000000274511401065455020254 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_Sensor/0000755000175000017500000000000011401065455022145 5ustar guillaumeguillaumeopendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_Sensor/cmpiOpenDRIM_Sensor.h0000644000175000017500000000544111401065455026101 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_SENSOR_H_ #define CMPIOPENDRIM_SENSOR_H_ #include "OpenDRIM_Sensor.h" CMPIObjectPath* Sensors_OpenDRIM_Sensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_Sensor& instance); CMPIInstance* Sensors_OpenDRIM_Sensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_Sensor& instance); void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_Sensor& instance); void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_Sensor& instance); void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Sensor_RequestStateChange_In& args); void Sensors_OpenDRIM_Sensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_Sensor_RequestStateChange_Out& args); void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Sensor_SetPowerState_In& args); void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Sensor_EnableDevice_In& args); void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Sensor_OnlineDevice_In& args); void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Sensor_QuiesceDevice_In& args); #endif /*CMPIOPENDRIM_SENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_Sensor/Makefile.am0000644000175000017500000000366311401065455024211 0ustar guillaumeguillaume################################################################################ # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ################################################################################ providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiSensors_OpenDRIM_SensorProvider.la libcmpiSensors_OpenDRIM_SensorProvider_la_SOURCES = OpenDRIM_SensorAccess.cpp OpenDRIM_SensorProvider.cpp cmpiOpenDRIM_Sensor.cpp libcmpiSensors_OpenDRIM_SensorProvider_la_LIBADD = ../Common/libcmpiSensors_Common.la libcmpiSensors_OpenDRIM_SensorProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_Sensor.h OpenDRIM_Sensor.h OpenDRIM_SensorAccess.h opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_Sensor/cmpiOpenDRIM_Sensor.cpp0000644000175000017500000003465611401065455026446 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Sensor.h" CMPIObjectPath* Sensors_OpenDRIM_Sensor_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_Sensor& instance) { _E_; Objectpath op(broker, OpenDRIM_Sensor_classnames[0], OpenDRIM_Sensor_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* Sensors_OpenDRIM_Sensor_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_Sensor& instance) { _E_; Objectpath op(broker, Sensors_OpenDRIM_Sensor_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.SensorType_isNULL) ci.setProperty("SensorType", instance.SensorType); if (!instance.OtherSensorTypeDescription_isNULL) ci.setProperty("OtherSensorTypeDescription", instance.OtherSensorTypeDescription); if (!instance.PossibleStates_isNULL) ci.setProperty("PossibleStates", instance.PossibleStates); if (!instance.CurrentState_isNULL) ci.setProperty("CurrentState", instance.CurrentState); if (!instance.PollingInterval_isNULL) ci.setProperty("PollingInterval", instance.PollingInterval); _L_; return ci.getHdl(); } void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_Sensor& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_Sensor& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getProperty("SensorType", instance.SensorType) == OK) instance.SensorType_isNULL = false; if (inst.getProperty("OtherSensorTypeDescription", instance.OtherSensorTypeDescription) == OK) instance.OtherSensorTypeDescription_isNULL = false; if (inst.getProperty("PossibleStates", instance.PossibleStates) == OK) instance.PossibleStates_isNULL = false; if (inst.getProperty("CurrentState", instance.CurrentState) == OK) instance.CurrentState_isNULL = false; if (inst.getProperty("PollingInterval", instance.PollingInterval) == OK) instance.PollingInterval_isNULL = false; _L_; } void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Sensor_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 Sensors_OpenDRIM_Sensor_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_Sensor_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 Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Sensor_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Sensor_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Sensor_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void Sensors_OpenDRIM_Sensor_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Sensor_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_Sensor/OpenDRIM_SensorAccess.cpp0000644000175000017500000001163711401065455026711 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_SensorAccess.h" int Sensors_OpenDRIM_Sensor_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_Sensor_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int Sensors_OpenDRIM_Sensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_Sensor& instance, const char** properties, string& errorMessage) { _E_; _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& newInstance, const OpenDRIM_Sensor& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, const OpenDRIM_Sensor_RequestStateChange_In& in, OpenDRIM_Sensor_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, const OpenDRIM_Sensor_SetPowerState_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, const OpenDRIM_Sensor_EnableDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, const OpenDRIM_Sensor_OnlineDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, const OpenDRIM_Sensor_QuiesceDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Sensors_OpenDRIM_Sensor_populate(OpenDRIM_Sensor& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_Sensor/OpenDRIM_Sensor.h0000644000175000017500000005360111401065455025231 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_SENSOR_H_ #define OPENDRIM_SENSOR_H_ #include const static char* OpenDRIM_Sensor_classnames[] = {"OpenDRIM_Sensor"}; static string OpenDRIM_Sensor_NAMESPACE = _NAMESPACE; class OpenDRIM_Sensor { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; unsigned short SensorType; bool SensorType_isNULL; string OtherSensorTypeDescription; bool OtherSensorTypeDescription_isNULL; vector PossibleStates; bool PossibleStates_isNULL; string CurrentState; bool CurrentState_isNULL; unsigned long long PollingInterval; bool PollingInterval_isNULL; OpenDRIM_Sensor() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; SensorType_isNULL = true; OtherSensorTypeDescription_isNULL = true; PossibleStates_isNULL = true; CurrentState_isNULL = true; PollingInterval_isNULL = true; } ~OpenDRIM_Sensor() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getSensorType(unsigned short& value) const { if (SensorType_isNULL==true) return NOT_FOUND; value = SensorType; return OK; } int setSensorType(const unsigned short& newValue) { SensorType = newValue; SensorType_isNULL = false; return OK; } int getOtherSensorTypeDescription(string& value) const { if (OtherSensorTypeDescription_isNULL==true) return NOT_FOUND; value = OtherSensorTypeDescription; return OK; } int setOtherSensorTypeDescription(const string& newValue) { OtherSensorTypeDescription = newValue; OtherSensorTypeDescription_isNULL = false; return OK; } int getPossibleStates(vector& value) const { if (PossibleStates_isNULL==true) return NOT_FOUND; value = PossibleStates; return OK; } int setPossibleStates(const vector& newValue) { PossibleStates = newValue; PossibleStates_isNULL = false; return OK; } int getCurrentState(string& value) const { if (CurrentState_isNULL==true) return NOT_FOUND; value = CurrentState; return OK; } int setCurrentState(const string& newValue) { CurrentState = newValue; CurrentState_isNULL = false; return OK; } int getPollingInterval(unsigned long long& value) const { if (PollingInterval_isNULL==true) return NOT_FOUND; value = PollingInterval; return OK; } int setPollingInterval(const unsigned long long& newValue) { PollingInterval = newValue; PollingInterval_isNULL = false; return OK; } }; class OpenDRIM_Sensor_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_Sensor_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_Sensor_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_Sensor_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_Sensor_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_Sensor_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_Sensor_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_Sensor_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_Sensor_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_Sensor_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_Sensor_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_Sensor_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_Sensor_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_Sensor_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_Sensor_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_Sensor_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_Sensor_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_Sensor_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; #endif /*OPENDRIM_SENSOR_H_*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_Sensor/OpenDRIM_SensorProvider.cpp0000644000175000017500000004073711401065455027305 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Sensor.h" #include "OpenDRIM_SensorAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Sensors_OpenDRIM_SensorProviderSetInstance Sensors_OpenDRIM_SensorProviderModifyInstance #endif int Sensors_OpenDRIM_Sensor_init(const CMPIBroker* broker); int Sensors_OpenDRIM_Sensor_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Sensors_OpenDRIM_SensorProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_Sensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Sensors_OpenDRIM_Sensor_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Sensors_OpenDRIM_Sensor_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorProviderEnumInstances(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 = Sensors_OpenDRIM_Sensor_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Sensors_OpenDRIM_Sensor_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Sensor instance; Sensors_OpenDRIM_Sensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_Sensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Sensors_OpenDRIM_Sensor_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorProviderSetInstance(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_Sensor newInstance, oldInstance; Sensors_OpenDRIM_Sensor_toCPP(_broker, ci, newInstance); Sensors_OpenDRIM_Sensor_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Sensors_OpenDRIM_Sensor_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_Sensor_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Sensor instance; Sensors_OpenDRIM_Sensor_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_Sensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_Sensor_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_Sensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Sensors_OpenDRIM_Sensor_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Sensor instance; Sensors_OpenDRIM_Sensor_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Sensors_OpenDRIM_Sensor_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Sensors_OpenDRIM_Sensor_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorProviderExecQuery(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 Sensors_OpenDRIM_SensorProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = Sensors_OpenDRIM_Sensor_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Sensors_OpenDRIM_SensorProviderInvokeMethod(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_Sensor instance; Sensors_OpenDRIM_Sensor_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = Sensors_OpenDRIM_Sensor_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_Sensor_RequestStateChange_In inArgs; Sensors_OpenDRIM_Sensor_toCPP(_broker, in, inArgs); OpenDRIM_Sensor_RequestStateChange_Out outArgs; errorCode = Sensors_OpenDRIM_Sensor_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } Sensors_OpenDRIM_Sensor_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_Sensor_SetPowerState_In inArgs; Sensors_OpenDRIM_Sensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_Sensor_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_Sensor_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_Sensor_EnableDevice_In inArgs; Sensors_OpenDRIM_Sensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_Sensor_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_Sensor_OnlineDevice_In inArgs; Sensors_OpenDRIM_Sensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_Sensor_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_Sensor_QuiesceDevice_In inArgs; Sensors_OpenDRIM_Sensor_toCPP(_broker, in, inArgs); errorCode = Sensors_OpenDRIM_Sensor_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_Sensor_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = Sensors_OpenDRIM_Sensor_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Sensor_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_Sensor_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 Sensors_OpenDRIM_Sensor_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Sensors_OpenDRIM_Sensor_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_Sensor_init FAILED: " + (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Sensors_OpenDRIM_Sensor_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Sensors_OpenDRIM_Sensor_unload(errorMessage); if (errorCode != OK) { errorMessage += "Sensors_OpenDRIM_Sensor_unload FAILED: " + (string) OpenDRIM_Sensor_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Sensors_OpenDRIM_Sensor_INIT if (Sensors_OpenDRIM_Sensor_init(_broker) < 0) return NULL CMInstanceMIStub(Sensors_OpenDRIM_SensorProvider, Sensors_OpenDRIM_SensorProvider, _broker, Sensors_OpenDRIM_Sensor_INIT); CMMethodMIStub(Sensors_OpenDRIM_SensorProvider, Sensors_OpenDRIM_SensorProvider, _broker, Sensors_OpenDRIM_Sensor_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-sensors-1.0.0~ppa/OpenDRIM_Sensor/OpenDRIM_SensorAccess.h0000644000175000017500000001054311401065455026351 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Sensors provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_SENSORACCESS_H_ #define OPENDRIM_SENSORACCESS_H_ #include "Sensors_Common.h" #include "OpenDRIM_Sensor.h" int Sensors_OpenDRIM_Sensor_load(const CMPIBroker* broker, string& errorMessage); int Sensors_OpenDRIM_Sensor_unload(string& errorMessage); int Sensors_OpenDRIM_Sensor_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Sensors_OpenDRIM_Sensor_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_Sensor& instance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_Sensor_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& newInstance, const OpenDRIM_Sensor& oldInstance, const char** properties, string& errorMessage); int Sensors_OpenDRIM_Sensor_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, string& errorMessage); int Sensors_OpenDRIM_Sensor_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, string& errorMessage); int Sensors_OpenDRIM_Sensor_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, const OpenDRIM_Sensor_RequestStateChange_In& in, OpenDRIM_Sensor_RequestStateChange_Out& out, string& errorMessage); int Sensors_OpenDRIM_Sensor_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, const OpenDRIM_Sensor_SetPowerState_In& in, string& errorMessage); int Sensors_OpenDRIM_Sensor_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_Sensor_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, const OpenDRIM_Sensor_EnableDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_Sensor_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, const OpenDRIM_Sensor_OnlineDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_Sensor_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, const OpenDRIM_Sensor_QuiesceDevice_In& in, string& errorMessage); int Sensors_OpenDRIM_Sensor_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_Sensor_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Sensor& instance, unsigned int& returnValue, string& errorMessage); int Sensors_OpenDRIM_Sensor_populate(OpenDRIM_Sensor& instance, string& errorMessage); #endif /*OPENDRIM_SENSORACCESS_H_*/ opendrim-lmp-sensors-1.0.0~ppa/README0000644000175000017500000000103311401065455020114 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!