blob: 0353b2572c0423fd5c00b3f76b841eac36d2f188 [file] [log] [blame]
Rashmica Gupta80223232023-06-19 14:10:14 +10001#ifndef LIBPLDM_SRC_TRANSPORT_TRANSPORT_H
2#define LIBPLDM_SRC_TRANSPORT_TRANSPORT_H
Rashmica Guptac1b66f42022-12-09 16:24:45 +11003
4#include "libpldm/base.h"
5#include "libpldm/requester/pldm.h"
6struct pollfd;
7
8/**
9 * @brief Generic PLDM transport struct
10 *
11 * @var name - name of the transport
12 * @var version - version of transport to use
13 * @var recv - pointer to the transport specific function to receive a message
14 * @var send - pointer to the transport specific function to send a message
15 * @var init_pollfd - pointer to the transport specific init_pollfd function
16 */
17struct pldm_transport {
18 const char *name;
19 uint8_t version;
20 pldm_requester_rc_t (*recv)(struct pldm_transport *transport,
21 pldm_tid_t tid, void **pldm_resp_msg,
22 size_t *resp_msg_len);
23 pldm_requester_rc_t (*send)(struct pldm_transport *transport,
24 pldm_tid_t tid, const void *pldm_req_msg,
25 size_t req_msg_len);
26 int (*init_pollfd)(struct pldm_transport *transport,
27 struct pollfd *pollfd);
28};
29
Rashmica Gupta80223232023-06-19 14:10:14 +100030#endif // LIBPLDM_SRC_TRANSPORT_TRANSPORT_H