oem_ibm: Persist the remote PDRs before merging

This commit persists the remote range PDRs in the repo
before they are merged. This change was needed as the
remote terminus would not send down to BMC the entity
Association PDRs of the remote terminus after the BMC
takes a reset after the PDR exchange as the PDRs will be
in BMC range of record handles.

TESTED: Tested by triggering a PDR exchange with the
remote terminus by doing poweron test and also reset the
BMC after the PDR exchange.

Change-Id: Iec2109073f984e5980d9b6e445ce0fa4198d4a0f
Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
diff --git a/host-bmc/host_pdr_handler.hpp b/host-bmc/host_pdr_handler.hpp
index a76cc20..8a4e21a 100644
--- a/host-bmc/host_pdr_handler.hpp
+++ b/host-bmc/host_pdr_handler.hpp
@@ -4,6 +4,7 @@
 #include "common/types.hpp"
 #include "common/utils.hpp"
 #include "libpldmresponder/event_parser.hpp"
+#include "libpldmresponder/oem_handler.hpp"
 #include "libpldmresponder/pdr_utils.hpp"
 #include "requester/handler.hpp"
 
@@ -93,7 +94,8 @@
         pldm_entity_association_tree* entityTree,
         pldm_entity_association_tree* bmcEntityTree,
         pldm::InstanceIdDb& instanceIdDb,
-        pldm::requester::Handler<pldm::requester::Request>* handler);
+        pldm::requester::Handler<pldm::requester::Request>* handler,
+        pldm::responder::oem_platform::Handler* oemPlatformHandler);
 
     /** @brief fetch PDRs from host firmware. See @class.
      *  @param[in] recordHandles - list of record handles pointing to host's
@@ -182,8 +184,13 @@
      *  @details A merge operation involves adding a pldm_entity under the
      *  appropriate parent, and updating container ids.
      *  @param[in] pdr - entity association pdr
+     *  @param[in] size - size of input PDR record in bytes
+     *  @param[in] record_handle - record handle of the PDR
      */
-    void mergeEntityAssociations(const std::vector<uint8_t>& pdr);
+    void
+        mergeEntityAssociations(const std::vector<uint8_t>& pdr,
+                                [[maybe_unused]] const uint32_t& size,
+                                [[maybe_unused]] const uint32_t& record_handle);
 
     /** @brief process the Host's PDR and add to BMC's PDR repo
      *  @param[in] eid - MCTP id of Host
@@ -324,6 +331,9 @@
      */
     std::vector<responder::pdr_utils::FruRecordDataFormat> fruRecordData;
 
+    /** @OEM platform handler */
+    pldm::responder::oem_platform::Handler* oemPlatformHandler;
+
     /** @brief Object path and entity association and is only loaded once
      */
     bool objPathEntityAssociation;