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" |
Lakshminarayana R. Kammath | 58229b2 | 2019-08-09 06:30:04 -0500 | [diff] [blame^] | 18 | #include "libpldm/platform.h" |
Lakshminarayana R. Kammath | 27693a4 | 2019-06-24 00:51:47 -0500 | [diff] [blame] | 19 | |
| 20 | using namespace pldm::responder::utils; |
| 21 | |
| 22 | /** @brief Print the buffer |
| 23 | * |
| 24 | * @param[in] buffer - Buffer to print |
| 25 | * |
| 26 | * @return - None |
| 27 | */ |
| 28 | void printBuffer(const std::vector<uint8_t>& buffer); |
| 29 | |
| 30 | /** @brief MCTP socket read/recieve |
| 31 | * |
| 32 | * @param[in] requestMsg - Request message to compare against loopback |
| 33 | * message recieved from mctp socket |
| 34 | * @param[out] responseMsg - Response buffer recieved from mctp socket |
| 35 | * |
| 36 | * @return - 0 on success. |
| 37 | * -1 or -errno on failure. |
| 38 | */ |
| 39 | int mctpSockSendRecv(const std::vector<uint8_t>& requestMsg, |
| 40 | std::vector<uint8_t>& responseMsg); |
| 41 | |
| 42 | #endif |