pldm: Convert to using libpldm transport APIs

A significant amount of logic can be removed by exploiting the new
transport APIs provided by libpldm. Switch the pldm repository over to
use these by introducing an RAII wrapper for the APIs. The current
stance is to continue using the legacy mctp-demux transport
implementation, but we also provide a build option to switch to the
AF_MCTP transport.

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: I366f079082b102cfc0e90db0f62208581eb8693e
Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
diff --git a/utilities/requester/set_state_effecter.cpp b/utilities/requester/set_state_effecter.cpp
index c71f079..4243f4c 100644
--- a/utilities/requester/set_state_effecter.cpp
+++ b/utilities/requester/set_state_effecter.cpp
@@ -1,5 +1,6 @@
+#include "common/transport.hpp"
+
 #include <libpldm/platform.h>
-#include <libpldm/pldm.h>
 
 #include <CLI/CLI.hpp>
 #include <phosphor-logging/lg2.hpp>
@@ -37,19 +38,14 @@
         return -1;
     }
 
-    // Open connection to MCTP socket
-    int fd = pldm_open();
-    if (-1 == fd)
-    {
-        error("Failed to init mctp");
-        return -1;
-    }
+    PldmTransport pldmTransport{};
 
-    uint8_t* responseMsg = nullptr;
+    void* responseMsg = nullptr;
     size_t responseMsgSize{};
     // Send PLDM request msg and wait for response
-    rc = pldm_send_recv(mctpEid, fd, requestMsg.data(), requestMsg.size(),
-                        &responseMsg, &responseMsgSize);
+    rc = pldmTransport.sendRecvMsg(static_cast<pldm_tid_t>(mctpEid),
+                                   requestMsg.data(), requestMsg.size(),
+                                   responseMsg, responseMsgSize);
     if (0 > rc)
     {
         error(