blob: f052785f08c2432b2eadd29e13e6f77f45a6e20c [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,
Rashmica Gupta24576292023-07-31 14:02:41 +100021 pldm_tid_t *tid, void **pldm_resp_msg,
Rashmica Guptaf1ebde42023-07-31 14:17:57 +100022 size_t *msg_len);
Rashmica Guptac1b66f42022-12-09 16:24:45 +110023 pldm_requester_rc_t (*send)(struct pldm_transport *transport,
Rashmica Guptaf1ebde42023-07-31 14:17:57 +100024 pldm_tid_t tid, const void *pldm_msg,
25 size_t msg_len);
Rashmica Guptac1b66f42022-12-09 16:24:45 +110026 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