transport: Generalise the pldm_transport_recv_msg() API

Currently pldm_transport_recv_msg() only works for requesters as the TID
param is an input. Responders need the source TID of the message
received so they know where to send the response.

The TID was being used to look up the EID mapped to the TID and failing
the function call if it didn't match. This check doesn't need to happen
at this level, and can be added in at the requester API level if
required.

Make the TID param an output, and use the EID of the message to lookup
the TID.

Change-Id: I671dbfe2d94a9ad8d77ea0ef150f1c744f928c53
Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>
diff --git a/tests/transport.cpp b/tests/transport.cpp
index 83f0a34..0838751 100644
--- a/tests/transport.cpp
+++ b/tests/transport.cpp
@@ -47,12 +47,13 @@
 TEST(Transport, recv_one)
 {
     uint8_t msg[] = {0x01, 0x00, 0x01, 0x00};
+    const pldm_tid_t src_tid = 1;
     const struct pldm_transport_test_descriptor seq[] = {
         {
             .type = PLDM_TRANSPORT_TEST_ELEMENT_MSG_RECV,
             .recv_msg =
                 {
-                    .src = 1,
+                    .src = src_tid,
                     .msg = msg,
                     .len = sizeof(msg),
                 },
@@ -63,13 +64,15 @@
     void* recvd;
     size_t len;
     int rc;
+    pldm_tid_t tid;
 
     EXPECT_EQ(pldm_transport_test_init(&test, seq, ARRAY_SIZE(seq)), 0);
     ctx = pldm_transport_test_core(test);
-    rc = pldm_transport_recv_msg(ctx, 1, &recvd, &len);
+    rc = pldm_transport_recv_msg(ctx, &tid, &recvd, &len);
     EXPECT_EQ(rc, PLDM_REQUESTER_SUCCESS);
     EXPECT_EQ(len, sizeof(msg));
     EXPECT_EQ(memcmp(recvd, msg, len), 0);
+    EXPECT_EQ(tid, src_tid);
     free(recvd);
     pldm_transport_test_destroy(test);
 }