Move to libpldm pldm_transport APIs

- Replaced the deprecated pldm transport APIs with the new libpldm
  pldm_transport APIs.

This change migrates the application off of the deprecated "requester"
APIs in libpldm.

We don't currently have the infrastructure in place to get the correct
TIDs, so to keep everything working as before use the EID as the TID in
the EID-to-TID mapping.

Change-Id: Iedbfe936a710d37f75e737c3d307295ff55cf07b
Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
diff --git a/pldm.hpp b/pldm.hpp
index 641153f..1f1bad1 100644
--- a/pldm.hpp
+++ b/pldm.hpp
@@ -6,6 +6,8 @@
 
 #include <libpldm/instance-id.h>
 #include <libpldm/pldm.h>
+#include <libpldm/transport.h>
+#include <libpldm/transport/mctp-demux.h>
 
 #include <sdbusplus/bus/match.hpp>
 #include <sdeventplus/event.hpp>
@@ -29,15 +31,15 @@
 using SensorToInstance = std::map<SensorID, open_power::occ::instanceID>;
 using TerminusID = uint8_t;
 
-/** @brief Hardcoded TID */
-constexpr TerminusID tid = 0;
-
 /** @brief OCC instance starts with 0 for example "occ0" */
 constexpr open_power::occ::instanceID start = 0;
 
 /** @brief Hardcoded mctpEid for HBRT */
 constexpr mctp_eid_t mctpEid = 10;
 
+/** @brief Hardcoded TID */
+constexpr TerminusID tid = mctpEid;
+
 /** @class Interface
  *
  *  @brief Abstracts the PLDM details related to the OCC
@@ -252,6 +254,11 @@
     /** @brief File descriptor for PLDM messages */
     int pldmFd = -1;
 
+    /** pldm transport instance  */
+    struct pldm_transport* pldmTransport = NULL;
+
+    struct pldm_transport_mctp_demux* mctpDemux;
+
     /** @brief The response for the PLDM request msg is received flag.
      */
     bool pldmResponseReceived = false;
@@ -341,6 +348,19 @@
      */
     std::vector<uint8_t> encodeGetStateSensorRequest(uint8_t instance,
                                                      uint16_t sensorId);
+
+    /** @brief setup PLDM transport for sending and receiving PLDM messages.
+     *
+     * @return true on success, otherwise return false
+     */
+    int pldmOpen(void);
+
+    /** @brief Opens the MCTP socket for sending and receiving messages.
+     *
+     * @return true on success, otherwise returns a negative error code
+     */
+    int openMctpDemuxTransport();
+
     /** @brief Send the PLDM request
      *
      * @param[in] request - the request data