blob: 2533ca6a0091fa4b879142d497ccb1cb4f69c568 [file] [log] [blame]
/**
* This file is 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"
/**
* @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
*/
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
*/
pldm_requester_rc_t pldmRecvAtNetwork(mctp_eid_t eid, int networkId, int mctpFd,
uint8_t instanceId, uint8_t** pldmRespMsg,
size_t* respMsgLen);
#endif // BMC_PLDM_HPP