Tom Joseph | 6b7a143 | 2017-05-19 10:43:36 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <cstdint> |
| 4 | #include <sdbusplus/server.hpp> |
| 5 | #include "types.hpp" |
| 6 | |
| 7 | namespace ipmi |
| 8 | { |
| 9 | |
| 10 | namespace sel |
| 11 | { |
| 12 | |
| 13 | static constexpr auto mapperBusName = "xyz.openbmc_project.ObjectMapper"; |
| 14 | static constexpr auto mapperObjPath = "/xyz/openbmc_project/object_mapper"; |
| 15 | static constexpr auto mapperIntf = "xyz.openbmc_project.ObjectMapper"; |
| 16 | |
| 17 | static constexpr auto logBasePath = "/xyz/openbmc_project/logging/entry"; |
| 18 | static constexpr auto logEntryIntf = "xyz.openbmc_project.Logging.Entry"; |
| 19 | static constexpr auto logDeleteIntf = "xyz.openbmc_project.Object.Delete"; |
| 20 | |
| 21 | static constexpr auto propIntf = "org.freedesktop.DBus.Properties"; |
| 22 | |
| 23 | using PropertyType = sdbusplus::message::variant<bool, uint32_t, uint64_t, |
| 24 | std::string, std::vector<std::string>>; |
| 25 | |
| 26 | /** @struct GetSELEntryResponse |
| 27 | * |
| 28 | * IPMI payload for Get SEL Entry command response. |
| 29 | */ |
| 30 | struct GetSELEntryResponse |
| 31 | { |
| 32 | uint16_t nextRecordID; //!< Next RecordID. |
| 33 | uint16_t recordID; //!< Record ID. |
| 34 | uint8_t recordType; //!< Record Type. |
| 35 | uint32_t timeStamp; //!< Timestamp. |
| 36 | uint16_t generatorID; //!< Generator ID. |
| 37 | uint8_t eventMsgRevision; //!< Event Message Revision. |
| 38 | uint8_t sensorType; //!< Sensor Type. |
| 39 | uint8_t sensorNum; //!< Sensor Number. |
| 40 | uint8_t eventType; //!< Event Dir | Event Type. |
| 41 | uint8_t eventData1; //!< Event Data 1. |
| 42 | uint8_t eventData2; //!< Event Data 2. |
| 43 | uint8_t eventData3; //!< Event Data 3. |
| 44 | } __attribute__((packed)); |
| 45 | |
Tom Joseph | 6edc8a0 | 2017-06-30 18:52:56 +0530 | [diff] [blame] | 46 | /** @brief Convert logging entry to SEL |
| 47 | * |
| 48 | * @param[in] objPath - DBUS object path of the logging entry. |
| 49 | * |
| 50 | * @return On success return the response of Get SEL entry command. |
| 51 | */ |
| 52 | GetSELEntryResponse convertLogEntrytoSEL(const std::string& objPath); |
| 53 | |
| 54 | |
Tom Joseph | 6b7a143 | 2017-05-19 10:43:36 +0530 | [diff] [blame] | 55 | namespace internal |
| 56 | { |
| 57 | |
| 58 | /** @brief Convert logging entry to SEL event record |
| 59 | * |
| 60 | * @param[in] objPath - DBUS object path of the logging entry. |
| 61 | * @param[in] iter - Iterator to the sensor data corresponding to the logging |
| 62 | * entry |
| 63 | * |
| 64 | * @return On success return the SEL event record, throw an exception in case |
| 65 | * of failure. |
| 66 | */ |
| 67 | GetSELEntryResponse prepareSELEntry( |
| 68 | const std::string& objPath, |
| 69 | ipmi::sensor::InvObjectIDMap::const_iterator iter); |
| 70 | |
| 71 | } //internal |
| 72 | |
| 73 | } // namespace sel |
| 74 | |
| 75 | } // namespace ipmi |