| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 1 | #pragma once | 
|  | 2 |  | 
| Andrew Jeffery | 2abbce7 | 2023-10-18 10:17:35 +1030 | [diff] [blame] | 3 | #include "common/instance_id.hpp" | 
| Deepak Kodihalli | d130e1a | 2020-06-17 05:55:32 -0500 | [diff] [blame] | 4 | #include "common/types.hpp" | 
|  | 5 | #include "common/utils.hpp" | 
| Pavithra Barithaya | 3aec997 | 2020-12-14 01:55:44 -0600 | [diff] [blame] | 6 | #include "libpldmresponder/event_parser.hpp" | 
| Sagar Srinivas | 3687e2b | 2023-04-10 05:08:28 -0500 | [diff] [blame] | 7 | #include "libpldmresponder/oem_handler.hpp" | 
| Tom Joseph | b426860 | 2020-04-17 17:20:45 +0530 | [diff] [blame] | 8 | #include "libpldmresponder/pdr_utils.hpp" | 
| Tom Joseph | 74f27c7 | 2021-05-16 07:58:53 -0700 | [diff] [blame] | 9 | #include "requester/handler.hpp" | 
| Kamalkumar Patel | 4e69d25 | 2024-05-10 08:48:03 -0500 | [diff] [blame] | 10 | #include "utils.hpp" | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 11 |  | 
| George Liu | c453e16 | 2022-12-21 17:16:23 +0800 | [diff] [blame] | 12 | #include <libpldm/base.h> | 
|  | 13 | #include <libpldm/platform.h> | 
|  | 14 |  | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 15 | #include <sdeventplus/event.hpp> | 
| Deepak Kodihalli | 8cb6f66 | 2020-04-10 02:55:43 -0500 | [diff] [blame] | 16 | #include <sdeventplus/source/event.hpp> | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 17 |  | 
| Deepak Kodihalli | 7246e0c | 2020-07-08 06:40:18 -0500 | [diff] [blame] | 18 | #include <deque> | 
| George Liu | df9a6d3 | 2020-12-22 16:27:16 +0800 | [diff] [blame] | 19 | #include <filesystem> | 
| George Liu | 6492f52 | 2020-06-16 10:34:05 +0800 | [diff] [blame] | 20 | #include <map> | 
|  | 21 | #include <memory> | 
|  | 22 | #include <vector> | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 23 |  | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 24 | namespace pldm | 
|  | 25 | { | 
| Deepak Kodihalli | 8cb6f66 | 2020-04-10 02:55:43 -0500 | [diff] [blame] | 26 | // vector which would hold the PDR record handle data returned by | 
|  | 27 | // pldmPDRRepositoryChgEvent event data | 
|  | 28 | using ChangeEntry = uint32_t; | 
| Deepak Kodihalli | 7246e0c | 2020-07-08 06:40:18 -0500 | [diff] [blame] | 29 | using PDRRecordHandles = std::deque<ChangeEntry>; | 
| Deepak Kodihalli | 8cb6f66 | 2020-04-10 02:55:43 -0500 | [diff] [blame] | 30 |  | 
| Tom Joseph | b426860 | 2020-04-17 17:20:45 +0530 | [diff] [blame] | 31 | /** @struct SensorEntry | 
|  | 32 | * | 
|  | 33 | *  SensorEntry is a unique key which maps a sensorEventType request in the | 
|  | 34 | *  PlatformEventMessage command to a host sensor PDR. This struct is a key | 
|  | 35 | *  in a std::map, so implemented operator==and operator<. | 
|  | 36 | */ | 
|  | 37 | struct SensorEntry | 
|  | 38 | { | 
|  | 39 | pdr::TerminusID terminusID; | 
|  | 40 | pdr::SensorID sensorID; | 
|  | 41 |  | 
|  | 42 | bool operator==(const SensorEntry& e) const | 
|  | 43 | { | 
|  | 44 | return ((terminusID == e.terminusID) && (sensorID == e.sensorID)); | 
|  | 45 | } | 
|  | 46 |  | 
|  | 47 | bool operator<(const SensorEntry& e) const | 
|  | 48 | { | 
|  | 49 | return ((terminusID < e.terminusID) || | 
|  | 50 | ((terminusID == e.terminusID) && (sensorID < e.sensorID))); | 
|  | 51 | } | 
|  | 52 | }; | 
|  | 53 |  | 
|  | 54 | using HostStateSensorMap = std::map<SensorEntry, pdr::SensorInfo>; | 
| Sampa Misra | 868c879 | 2020-05-26 03:12:13 -0500 | [diff] [blame] | 55 | using PDRList = std::vector<std::vector<uint8_t>>; | 
| Tom Joseph | b426860 | 2020-04-17 17:20:45 +0530 | [diff] [blame] | 56 |  | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 57 | /** @class HostPDRHandler | 
|  | 58 | *  @brief This class can fetch and process PDRs from host firmware | 
|  | 59 | *  @details Provides an API to fetch PDRs from the host firmware. Upon | 
|  | 60 | *  receiving the PDRs, they are stored into the BMC's primary PDR repo. | 
|  | 61 | *  Adjustments are made to entity association PDRs received from the host, | 
|  | 62 | *  because they need to be assimilated into the BMC's entity association | 
|  | 63 | *  tree. A PLDM event containing the record handles of the updated entity | 
|  | 64 | *  association PDRs is sent to the host. | 
|  | 65 | */ | 
|  | 66 | class HostPDRHandler | 
|  | 67 | { | 
|  | 68 | public: | 
|  | 69 | HostPDRHandler() = delete; | 
|  | 70 | HostPDRHandler(const HostPDRHandler&) = delete; | 
|  | 71 | HostPDRHandler(HostPDRHandler&&) = delete; | 
|  | 72 | HostPDRHandler& operator=(const HostPDRHandler&) = delete; | 
|  | 73 | HostPDRHandler& operator=(HostPDRHandler&&) = delete; | 
|  | 74 | ~HostPDRHandler() = default; | 
|  | 75 |  | 
| Manojkiran Eda | 60e1fe9 | 2021-10-08 15:58:16 +0530 | [diff] [blame] | 76 | using TerminusInfo = | 
|  | 77 | std::tuple<pdr::TerminusID, pdr::EID, pdr::TerminusValidity>; | 
|  | 78 | using TLPDRMap = std::map<pdr::TerminusHandle, TerminusInfo>; | 
| Sampa Misra | 868c879 | 2020-05-26 03:12:13 -0500 | [diff] [blame] | 79 |  | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 80 | /** @brief Constructor | 
|  | 81 | *  @param[in] mctp_fd - fd of MCTP communications socket | 
|  | 82 | *  @param[in] mctp_eid - MCTP EID of host firmware | 
|  | 83 | *  @param[in] event - reference of main event loop of pldmd | 
|  | 84 | *  @param[in] repo - pointer to BMC's primary PDR repo | 
| Pavithra Barithaya | 3aec997 | 2020-12-14 01:55:44 -0600 | [diff] [blame] | 85 | *  @param[in] eventsJsonDir - directory path which has the config JSONs | 
| Tom Joseph | 74f27c7 | 2021-05-16 07:58:53 -0700 | [diff] [blame] | 86 | *  @param[in] entityTree - Pointer to BMC and Host entity association tree | 
|  | 87 | *  @param[in] bmcEntityTree - pointer to BMC's entity association tree | 
| Andrew Jeffery | a330b2f | 2023-05-04 14:55:37 +0930 | [diff] [blame] | 88 | *  @param[in] instanceIdDb - reference to an InstanceIdDb object | 
| Tom Joseph | 74f27c7 | 2021-05-16 07:58:53 -0700 | [diff] [blame] | 89 | *  @param[in] handler - PLDM request handler | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 90 | */ | 
| Tom Joseph | 74f27c7 | 2021-05-16 07:58:53 -0700 | [diff] [blame] | 91 | explicit HostPDRHandler( | 
|  | 92 | int mctp_fd, uint8_t mctp_eid, sdeventplus::Event& event, | 
|  | 93 | pldm_pdr* repo, const std::string& eventsJsonsDir, | 
|  | 94 | pldm_entity_association_tree* entityTree, | 
| Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 95 | pldm_entity_association_tree* bmcEntityTree, | 
| Andrew Jeffery | a330b2f | 2023-05-04 14:55:37 +0930 | [diff] [blame] | 96 | pldm::InstanceIdDb& instanceIdDb, | 
| George Liu | a881c17 | 2021-06-21 18:28:11 +0800 | [diff] [blame] | 97 | pldm::requester::Handler<pldm::requester::Request>* handler); | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 98 |  | 
|  | 99 | /** @brief fetch PDRs from host firmware. See @class. | 
|  | 100 | *  @param[in] recordHandles - list of record handles pointing to host's | 
|  | 101 | *             PDRs that need to be fetched. | 
|  | 102 | */ | 
| Pavithra Barithaya | e8beb89 | 2020-04-14 23:24:25 -0500 | [diff] [blame] | 103 |  | 
| Deepak Kodihalli | 7246e0c | 2020-07-08 06:40:18 -0500 | [diff] [blame] | 104 | void fetchPDR(PDRRecordHandles&& recordHandles); | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 105 |  | 
| Pavithra Barithaya | e8beb89 | 2020-04-14 23:24:25 -0500 | [diff] [blame] | 106 | /** @brief Send a PLDM event to host firmware containing a list of record | 
|  | 107 | *  handles of PDRs that the host firmware has to fetch. | 
|  | 108 | *  @param[in] pdrTypes - list of PDR types that need to be looked up in the | 
|  | 109 | *                        BMC repo | 
|  | 110 | *  @param[in] eventDataFormat - format for PDRRepositoryChgEvent in DSP0248 | 
|  | 111 | */ | 
|  | 112 | void sendPDRRepositoryChgEvent(std::vector<uint8_t>&& pdrTypes, | 
|  | 113 | uint8_t eventDataFormat); | 
|  | 114 |  | 
| Tom Joseph | b426860 | 2020-04-17 17:20:45 +0530 | [diff] [blame] | 115 | /** @brief Lookup host sensor info corresponding to requested SensorEntry | 
|  | 116 | * | 
|  | 117 | *  @param[in] entry - TerminusID and SensorID | 
|  | 118 | * | 
| Manojkiran Eda | 2576aec | 2024-06-17 12:05:17 +0530 | [diff] [blame] | 119 | *  @return SensorInfo corresponding to the input parameter SensorEntry | 
| Tom Joseph | b426860 | 2020-04-17 17:20:45 +0530 | [diff] [blame] | 120 | *          throw std::out_of_range exception if not found | 
|  | 121 | */ | 
|  | 122 | const pdr::SensorInfo& lookupSensorInfo(const SensorEntry& entry) const | 
|  | 123 | { | 
|  | 124 | return sensorMap.at(entry); | 
|  | 125 | } | 
|  | 126 |  | 
| Pavithra Barithaya | 3aec997 | 2020-12-14 01:55:44 -0600 | [diff] [blame] | 127 | /** @brief Handles state sensor event | 
|  | 128 | * | 
|  | 129 | *  @param[in] entry - state sensor entry | 
|  | 130 | *  @param[in] state - event state | 
|  | 131 | * | 
|  | 132 | *  @return PLDM completion code | 
|  | 133 | */ | 
| Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 134 | int handleStateSensorEvent( | 
|  | 135 | const pldm::responder::events::StateSensorEntry& entry, | 
|  | 136 | pdr::EventState state); | 
| Pavithra Barithaya | 3aec997 | 2020-12-14 01:55:44 -0600 | [diff] [blame] | 137 |  | 
| Sampa Misra | 868c879 | 2020-05-26 03:12:13 -0500 | [diff] [blame] | 138 | /** @brief Parse state sensor PDRs and populate the sensorMap lookup data | 
|  | 139 | *         structure | 
|  | 140 | * | 
|  | 141 | *  @param[in] stateSensorPDRs - host state sensor PDRs | 
| Sampa Misra | 868c879 | 2020-05-26 03:12:13 -0500 | [diff] [blame] | 142 | * | 
|  | 143 | */ | 
| Manojkiran Eda | 60e1fe9 | 2021-10-08 15:58:16 +0530 | [diff] [blame] | 144 | void parseStateSensorPDRs(const PDRList& stateSensorPDRs); | 
| Sampa Misra | 868c879 | 2020-05-26 03:12:13 -0500 | [diff] [blame] | 145 |  | 
| Sampa Misra | c0c7948 | 2021-06-02 08:01:54 -0500 | [diff] [blame] | 146 | /** @brief this function sends a GetPDR request to Host firmware. | 
|  | 147 | *  And processes the PDRs based on type | 
|  | 148 | * | 
|  | 149 | *  @param[in] - nextRecordHandle - the next record handle to ask for | 
|  | 150 | */ | 
|  | 151 | void getHostPDR(uint32_t nextRecordHandle = 0); | 
|  | 152 |  | 
| Sampa Misra | f9ba8c1 | 2021-08-06 00:33:47 -0500 | [diff] [blame] | 153 | /** @brief set the Host firmware condition when pldmd starts | 
| sampmisr | 6decfc1 | 2021-03-02 11:07:36 +0530 | [diff] [blame] | 154 | */ | 
| Sampa Misra | f9ba8c1 | 2021-08-06 00:33:47 -0500 | [diff] [blame] | 155 | void setHostFirmwareCondition(); | 
| sampmisr | 6decfc1 | 2021-03-02 11:07:36 +0530 | [diff] [blame] | 156 |  | 
| Pavithra Barithaya | 4f2538a | 2021-03-05 07:32:15 -0600 | [diff] [blame] | 157 | /** @brief set HostSensorStates when pldmd starts or restarts | 
|  | 158 | *  and updates the D-Bus property | 
|  | 159 | *  @param[in] stateSensorPDRs - host state sensor PDRs | 
| Pavithra Barithaya | 4f2538a | 2021-03-05 07:32:15 -0600 | [diff] [blame] | 160 | */ | 
| Manojkiran Eda | 60e1fe9 | 2021-10-08 15:58:16 +0530 | [diff] [blame] | 161 | void setHostSensorState(const PDRList& stateSensorPDRs); | 
| Pavithra Barithaya | 4f2538a | 2021-03-05 07:32:15 -0600 | [diff] [blame] | 162 |  | 
| Pavithra Barithaya | ae5c97e | 2022-08-29 02:57:59 -0500 | [diff] [blame] | 163 | /** @brief whether we received PLDM_RECORDS_MODIFIED event data operation | 
|  | 164 | *  from host | 
|  | 165 | */ | 
|  | 166 | bool isHostPdrModified = false; | 
|  | 167 |  | 
| sampmisr | 6decfc1 | 2021-03-02 11:07:36 +0530 | [diff] [blame] | 168 | /** @brief check whether Host is running when pldmd starts | 
|  | 169 | */ | 
|  | 170 | bool isHostUp(); | 
|  | 171 |  | 
| George Liu | a881c17 | 2021-06-21 18:28:11 +0800 | [diff] [blame] | 172 | /* @brief Method to set the oem platform handler in host pdr handler class | 
|  | 173 | * | 
|  | 174 | * @param[in] handler - oem platform handler | 
|  | 175 | */ | 
|  | 176 | inline void | 
|  | 177 | setOemPlatformHandler(pldm::responder::oem_platform::Handler* handler) | 
|  | 178 | { | 
|  | 179 | oemPlatformHandler = handler; | 
|  | 180 | } | 
|  | 181 |  | 
| Manojkiran Eda | 60e1fe9 | 2021-10-08 15:58:16 +0530 | [diff] [blame] | 182 | /** @brief map that captures various terminus information **/ | 
|  | 183 | TLPDRMap tlPDRInfo; | 
|  | 184 |  | 
| sampmisr | 6decfc1 | 2021-03-02 11:07:36 +0530 | [diff] [blame] | 185 | private: | 
|  | 186 | /** @brief deferred function to fetch PDR from Host, scheduled to work on | 
|  | 187 | *  the event loop. The PDR exchg with the host is async. | 
|  | 188 | *  @param[in] source - sdeventplus event source | 
|  | 189 | */ | 
|  | 190 | void _fetchPDR(sdeventplus::source::EventBase& source); | 
|  | 191 |  | 
| Deepak Kodihalli | 87514cc | 2020-04-16 09:08:38 -0500 | [diff] [blame] | 192 | /** @brief Merge host firmware's entity association PDRs into BMC's | 
|  | 193 | *  @details A merge operation involves adding a pldm_entity under the | 
|  | 194 | *  appropriate parent, and updating container ids. | 
|  | 195 | *  @param[in] pdr - entity association pdr | 
| Sagar Srinivas | 3687e2b | 2023-04-10 05:08:28 -0500 | [diff] [blame] | 196 | *  @param[in] size - size of input PDR record in bytes | 
|  | 197 | *  @param[in] record_handle - record handle of the PDR | 
| Deepak Kodihalli | 87514cc | 2020-04-16 09:08:38 -0500 | [diff] [blame] | 198 | */ | 
| Sagar Srinivas | 3687e2b | 2023-04-10 05:08:28 -0500 | [diff] [blame] | 199 | void | 
|  | 200 | mergeEntityAssociations(const std::vector<uint8_t>& pdr, | 
|  | 201 | [[maybe_unused]] const uint32_t& size, | 
|  | 202 | [[maybe_unused]] const uint32_t& record_handle); | 
| Deepak Kodihalli | 87514cc | 2020-04-16 09:08:38 -0500 | [diff] [blame] | 203 |  | 
| Sampa Misra | c0c7948 | 2021-06-02 08:01:54 -0500 | [diff] [blame] | 204 | /** @brief process the Host's PDR and add to BMC's PDR repo | 
|  | 205 | *  @param[in] eid - MCTP id of Host | 
|  | 206 | *  @param[in] response - response from Host for GetPDR | 
|  | 207 | *  @param[in] respMsgLen - response message length | 
|  | 208 | */ | 
|  | 209 | void processHostPDRs(mctp_eid_t eid, const pldm_msg* response, | 
|  | 210 | size_t respMsgLen); | 
|  | 211 |  | 
|  | 212 | /** @brief send PDR Repo change after merging Host's PDR to BMC PDR repo | 
|  | 213 | *  @param[in] source - sdeventplus event source | 
|  | 214 | */ | 
|  | 215 | void _processPDRRepoChgEvent(sdeventplus::source::EventBase& source); | 
|  | 216 |  | 
|  | 217 | /** @brief fetch the next PDR based on the record handle sent by Host | 
|  | 218 | *  @param[in] nextRecordHandle - next record handle | 
|  | 219 | *  @param[in] source - sdeventplus event source | 
|  | 220 | */ | 
|  | 221 | void _processFetchPDREvent(uint32_t nextRecordHandle, | 
|  | 222 | sdeventplus::source::EventBase& source); | 
|  | 223 |  | 
| George Liu | 682ee18 | 2020-12-25 15:24:33 +0800 | [diff] [blame] | 224 | /** @brief Get FRU record table metadata by remote PLDM terminus | 
|  | 225 | * | 
|  | 226 | *  @param[out] uint16_t    - total table records | 
|  | 227 | */ | 
|  | 228 | void getFRURecordTableMetadataByRemote(const PDRList& fruRecordSetPDRs); | 
|  | 229 |  | 
|  | 230 | /** @brief Set Location Code in the dbus objects | 
|  | 231 | * | 
|  | 232 | *  @param[in] fruRecordSetPDRs - the Fru Record set PDR's | 
|  | 233 | *  @param[in] fruRecordData - the Fru Record Data | 
|  | 234 | */ | 
|  | 235 |  | 
|  | 236 | void setFRUDataOnDBus( | 
|  | 237 | const PDRList& fruRecordSetPDRs, | 
|  | 238 | const std::vector<responder::pdr_utils::FruRecordDataFormat>& | 
|  | 239 | fruRecordData); | 
|  | 240 |  | 
|  | 241 | /** @brief Get FRU record table by remote PLDM terminus | 
|  | 242 | * | 
|  | 243 | *  @param[in] fruRecordSetPDRs  - the Fru Record set PDR's | 
|  | 244 | *  @param[in] totalTableRecords - the Number of total table records | 
|  | 245 | *  @return | 
|  | 246 | */ | 
|  | 247 | void getFRURecordTableByRemote(const PDRList& fruRecordSetPDRs, | 
|  | 248 | uint16_t totalTableRecords); | 
|  | 249 |  | 
|  | 250 | /** @brief Create Dbus objects by remote PLDM entity Fru PDRs | 
|  | 251 | * | 
|  | 252 | *  @param[in] fruRecordSetPDRs - fru record set pdr | 
|  | 253 | * | 
|  | 254 | * @ return | 
|  | 255 | */ | 
|  | 256 | void createDbusObjects(const PDRList& fruRecordSetPDRs); | 
|  | 257 |  | 
|  | 258 | /** @brief Get FRU Record Set Identifier from FRU Record data Format | 
|  | 259 | *  @param[in] fruRecordSetPDRs - fru record set pdr | 
|  | 260 | *  @param[in] entity           - PLDM entity information | 
|  | 261 | *  @return | 
|  | 262 | */ | 
|  | 263 | std::optional<uint16_t> getRSI(const PDRList& fruRecordSetPDRs, | 
|  | 264 | const pldm_entity& entity); | 
|  | 265 |  | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 266 | /** @brief fd of MCTP communications socket */ | 
|  | 267 | int mctp_fd; | 
|  | 268 | /** @brief MCTP EID of host firmware */ | 
|  | 269 | uint8_t mctp_eid; | 
|  | 270 | /** @brief reference of main event loop of pldmd, primarily used to schedule | 
|  | 271 | *  work. | 
|  | 272 | */ | 
|  | 273 | sdeventplus::Event& event; | 
|  | 274 | /** @brief pointer to BMC's primary PDR repo, host PDRs are added here */ | 
|  | 275 | pldm_pdr* repo; | 
| Pavithra Barithaya | 3aec997 | 2020-12-14 01:55:44 -0600 | [diff] [blame] | 276 |  | 
| Brad Bishop | 5079ac4 | 2021-08-19 18:35:06 -0400 | [diff] [blame] | 277 | pldm::responder::events::StateSensorHandler stateSensorHandler; | 
| Sampa Misra | c073a20 | 2021-05-08 10:56:05 -0500 | [diff] [blame] | 278 | /** @brief Pointer to BMC's and Host's entity association tree */ | 
| Deepak Kodihalli | 87514cc | 2020-04-16 09:08:38 -0500 | [diff] [blame] | 279 | pldm_entity_association_tree* entityTree; | 
| Sampa Misra | c073a20 | 2021-05-08 10:56:05 -0500 | [diff] [blame] | 280 |  | 
|  | 281 | /** @brief Pointer to BMC's entity association tree */ | 
|  | 282 | pldm_entity_association_tree* bmcEntityTree; | 
|  | 283 |  | 
| Andrew Jeffery | a330b2f | 2023-05-04 14:55:37 +0930 | [diff] [blame] | 284 | /** @brief reference to Instance ID database object, used to obtain PLDM | 
|  | 285 | * instance IDs | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 286 | */ | 
| Andrew Jeffery | a330b2f | 2023-05-04 14:55:37 +0930 | [diff] [blame] | 287 | pldm::InstanceIdDb& instanceIdDb; | 
| Tom Joseph | 74f27c7 | 2021-05-16 07:58:53 -0700 | [diff] [blame] | 288 |  | 
|  | 289 | /** @brief PLDM request handler */ | 
| Sampa Misra | c0c7948 | 2021-06-02 08:01:54 -0500 | [diff] [blame] | 290 | pldm::requester::Handler<pldm::requester::Request>* handler; | 
| Tom Joseph | 74f27c7 | 2021-05-16 07:58:53 -0700 | [diff] [blame] | 291 |  | 
| Deepak Kodihalli | 8cb6f66 | 2020-04-10 02:55:43 -0500 | [diff] [blame] | 292 | /** @brief sdeventplus event source */ | 
|  | 293 | std::unique_ptr<sdeventplus::source::Defer> pdrFetchEvent; | 
| Sampa Misra | c0c7948 | 2021-06-02 08:01:54 -0500 | [diff] [blame] | 294 | std::unique_ptr<sdeventplus::source::Defer> deferredFetchPDREvent; | 
|  | 295 | std::unique_ptr<sdeventplus::source::Defer> deferredPDRRepoChgEvent; | 
|  | 296 |  | 
| Deepak Kodihalli | 8cb6f66 | 2020-04-10 02:55:43 -0500 | [diff] [blame] | 297 | /** @brief list of PDR record handles pointing to host's PDRs */ | 
|  | 298 | PDRRecordHandles pdrRecordHandles; | 
| Deepak Kodihalli | 87514cc | 2020-04-16 09:08:38 -0500 | [diff] [blame] | 299 | /** @brief maps an entity type to parent pldm_entity from the BMC's entity | 
|  | 300 | *  association tree | 
|  | 301 | */ | 
| Pavithra Barithaya | ae5c97e | 2022-08-29 02:57:59 -0500 | [diff] [blame] | 302 |  | 
|  | 303 | /** @brief list of PDR record handles modified pointing to host PDRs */ | 
|  | 304 | PDRRecordHandles modifiedPDRRecordHandles; | 
|  | 305 |  | 
| Deepak Kodihalli | 6b1d1ca | 2020-04-27 07:24:51 -0500 | [diff] [blame] | 306 | /** @brief D-Bus property changed signal match */ | 
| Patrick Williams | 84b790c | 2022-07-22 19:26:56 -0500 | [diff] [blame] | 307 | std::unique_ptr<sdbusplus::bus::match_t> hostOffMatch; | 
| Tom Joseph | b426860 | 2020-04-17 17:20:45 +0530 | [diff] [blame] | 308 |  | 
|  | 309 | /** @brief sensorMap is a lookup data structure that is build from the | 
|  | 310 | *         hostPDR that speeds up the lookup of <TerminusID, SensorID> in | 
|  | 311 | *         PlatformEventMessage command request. | 
|  | 312 | */ | 
|  | 313 | HostStateSensorMap sensorMap; | 
| sampmisr | 6decfc1 | 2021-03-02 11:07:36 +0530 | [diff] [blame] | 314 |  | 
|  | 315 | /** @brief whether response received from Host */ | 
|  | 316 | bool responseReceived; | 
| George Liu | acf2c8c | 2021-05-10 14:08:52 +0800 | [diff] [blame] | 317 |  | 
|  | 318 | /** @brief variable that captures if the first entity association PDR | 
|  | 319 | *         from host is merged into the BMC tree | 
|  | 320 | */ | 
|  | 321 | bool mergedHostParents; | 
|  | 322 |  | 
| George Liu | df9a6d3 | 2020-12-22 16:27:16 +0800 | [diff] [blame] | 323 | /** @brief maps an object path to pldm_entity from the BMC's entity | 
|  | 324 | *         association tree | 
|  | 325 | */ | 
| Kamalkumar Patel | 7d427f1 | 2024-05-16 03:44:00 -0500 | [diff] [blame] | 326 | pldm::utils::ObjectPathMaps objPathMap; | 
| George Liu | df9a6d3 | 2020-12-22 16:27:16 +0800 | [diff] [blame] | 327 |  | 
|  | 328 | /** @brief maps an entity name to map, maps to entity name to pldm_entity | 
|  | 329 | */ | 
| Kamalkumar Patel | 7d427f1 | 2024-05-16 03:44:00 -0500 | [diff] [blame] | 330 | pldm::utils::EntityAssociations entityAssociations; | 
| George Liu | 682ee18 | 2020-12-25 15:24:33 +0800 | [diff] [blame] | 331 |  | 
|  | 332 | /** @brief the vector of FRU Record Data Format | 
|  | 333 | */ | 
|  | 334 | std::vector<responder::pdr_utils::FruRecordDataFormat> fruRecordData; | 
|  | 335 |  | 
| Sagar Srinivas | 3687e2b | 2023-04-10 05:08:28 -0500 | [diff] [blame] | 336 | /** @OEM platform handler */ | 
| George Liu | a881c17 | 2021-06-21 18:28:11 +0800 | [diff] [blame] | 337 | pldm::responder::oem_platform::Handler* oemPlatformHandler = nullptr; | 
| Kamalkumar Patel | 516122e | 2024-05-07 04:39:32 -0500 | [diff] [blame] | 338 |  | 
|  | 339 | /** @brief entityID and entity name is only loaded once | 
|  | 340 | */ | 
| Kamalkumar Patel | 7d427f1 | 2024-05-16 03:44:00 -0500 | [diff] [blame] | 341 | pldm::utils::EntityMaps entityMaps; | 
| Pavithra Barithaya | 51efaf8 | 2020-04-02 02:42:27 -0500 | [diff] [blame] | 342 | }; | 
|  | 343 |  | 
|  | 344 | } // namespace pldm |