blob: 6a4f08754cba061604ab22755a345ac75799cc32 [file] [log] [blame]
Lakshminarayana R. Kammath27693a42019-06-24 00:51:47 -05001#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
19using namespace pldm::responder::utils;
20
21/** @brief Print the buffer
22 *
23 * @param[in] buffer - Buffer to print
24 *
25 * @return - None
26 */
27void 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 */
38int mctpSockSendRecv(const std::vector<uint8_t>& requestMsg,
39 std::vector<uint8_t>& responseMsg);
40
41#endif