Lakshminarayana R. Kammath | 27693a4 | 2019-06-24 00:51:47 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #ifndef PLDM_CMD_HELPER_H |
| 4 | #define PLDM_CMD_HELPER_H |
| 5 | |
| 6 | #include "libpldmresponder/utils.hpp" |
| 7 | |
| 8 | #include <err.h> |
| 9 | #include <sys/socket.h> |
| 10 | #include <sys/un.h> |
| 11 | #include <unistd.h> |
| 12 | |
| 13 | #include <cstring> |
| 14 | #include <iomanip> |
| 15 | #include <iostream> |
| 16 | |
| 17 | #include "libpldm/base.h" |
| 18 | |
| 19 | using namespace pldm::responder::utils; |
| 20 | |
| 21 | /** @brief Print the buffer |
| 22 | * |
| 23 | * @param[in] buffer - Buffer to print |
| 24 | * |
| 25 | * @return - None |
| 26 | */ |
| 27 | void printBuffer(const std::vector<uint8_t>& buffer); |
| 28 | |
| 29 | /** @brief MCTP socket read/recieve |
| 30 | * |
| 31 | * @param[in] requestMsg - Request message to compare against loopback |
| 32 | * message recieved from mctp socket |
| 33 | * @param[out] responseMsg - Response buffer recieved from mctp socket |
| 34 | * |
| 35 | * @return - 0 on success. |
| 36 | * -1 or -errno on failure. |
| 37 | */ |
| 38 | int mctpSockSendRecv(const std::vector<uint8_t>& requestMsg, |
| 39 | std::vector<uint8_t>& responseMsg); |
| 40 | |
| 41 | #endif |