core: Add TX/RX API that exposes message tag and tag owner
MCTP received packets can carry a message tag and tag owner bit
which is set by a remote MCTP endpoint. This can be used by the
remote MCTP endpoint to track the responses. Thus, libmctp should
provide a mechanism for the upper layer MCTP applications to
respond with the same message tag.
This patchset extends TX and RX API with message tag and
tag owner bits.
Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com>
Change-Id: I6d07eafa86c653abdd4313ab7cc77e5a93124477
diff --git a/utils/mctp-pipe.c b/utils/mctp-pipe.c
index ad466fb..12da74f 100644
--- a/utils/mctp-pipe.c
+++ b/utils/mctp-pipe.c
@@ -12,11 +12,11 @@
#include <sys/poll.h>
#include <sys/socket.h>
-static void rx_message(uint8_t eid, void *data, void *msg, size_t len)
+static void
+rx_message(uint8_t eid __unused, bool tag_owner __unused,
+ uint8_t msg_tag __unused, void *data __unused, void *msg, size_t len)
{
ssize_t rc;
- (void)eid;
- (void)data;
rc = write(STDOUT_FILENO, msg, len);
if (rc < 0)
@@ -91,7 +91,9 @@
} else if (rc < 0) {
err(EXIT_FAILURE, "read");
} else {
- mctp_message_tx(mctp[0], eids[1], buf, rc);
+ mctp_message_tx(mctp[0], eids[1],
+ MCTP_MESSAGE_TO_SRC, 0, buf,
+ rc);
}
}