blob: 28d7f9b4567fd7cb63a47fe9ec7815d0903096b5 [file] [log] [blame]
Rashmica Guptac1b66f42022-12-09 16:24:45 +11001#ifndef TRANSPORT_H
2#define TRANSPORT_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include "libpldm/base.h"
9#include "libpldm/requester/pldm.h"
10struct pollfd;
11
12/**
13 * @brief Generic PLDM transport struct
14 *
15 * @var name - name of the transport
16 * @var version - version of transport to use
17 * @var recv - pointer to the transport specific function to receive a message
18 * @var send - pointer to the transport specific function to send a message
19 * @var init_pollfd - pointer to the transport specific init_pollfd function
20 */
21struct pldm_transport {
22 const char *name;
23 uint8_t version;
24 pldm_requester_rc_t (*recv)(struct pldm_transport *transport,
25 pldm_tid_t tid, void **pldm_resp_msg,
26 size_t *resp_msg_len);
27 pldm_requester_rc_t (*send)(struct pldm_transport *transport,
28 pldm_tid_t tid, const void *pldm_req_msg,
29 size_t req_msg_len);
30 int (*init_pollfd)(struct pldm_transport *transport,
31 struct pollfd *pollfd);
32};
33
34#ifdef __cplusplus
35}
36#endif
37
38#endif // TRANSPORT_H