blob: a98e8fadbd6d0efcd87e8a8c9dbab045771dca72 [file] [log] [blame] [edit]
/**
* The pldmSend and pldmRecv are derived from the upstream implementation of
* send and recv With an extra network id parameter
*/
#pragma once
#ifndef BMC_PLDM_HPP
#define BMC_PLDM_HPP
#include "libpldm/base.h"
#include "libpldm/pldm.h"
#include "mctp.h"
class PldmInterface
{
public:
PldmInterface() = default;
~PldmInterface() = default;
/**
* @brief Sends the PLDM message to a specific network and eid
*
* @param[in] eid - Destination Eid
* @param[in] networkId - Network id for the device
* @param[in] mctpFd - Socket address
* @param[in] pldmReqMsg - Pointer to the request message
* @param[in] reqMsgLen - Length of the request message
*
* @return pldm_requester_rc_t
*/
virtual pldm_requester_rc_t pldmSendAtNetwork(mctp_eid_t eid, int networkId,
int mctpFd,
const uint8_t* pldmReqMsg,
size_t reqMsgLen);
/**
* @brief Receives the PLDM message from a specific network and eid
*
* @param[in] eid - Destination Eid
* @param[in] networkId - Network id for the device
* @param[in] mctpFd - Socket address
* @param[in] instanceId - Instance id for the req/resp
* @param[out] pldmRespMsg - Pointer to the response message
* @param[out] respMsgLen - Length of the response message
*
* @return pldm_requester_rc_t
*/
virtual pldm_requester_rc_t pldmRecvAtNetwork(mctp_eid_t eid, int networkId,
int mctpFd,
uint8_t instanceId,
uint8_t** pldmRespMsg,
size_t* respMsgLen);
private:
pldm_requester_rc_t mctpRecvAtNetwork(mctp_eid_t eid, int mctpFd,
uint8_t** pldmRespMsg,
size_t* respMsgLen, int networkId);
pldm_requester_rc_t recvAtNetwork(mctp_eid_t eid, int mctpFd,
uint8_t** pldmRespMsg, size_t* respMsgLen,
int networkId);
};
#endif // BMC_PLDM_HPP