Rashmica Gupta | 8022323 | 2023-06-19 14:10:14 +1000 | [diff] [blame] | 1 | #ifndef LIBPLDM_SRC_TRANSPORT_TRANSPORT_H |
| 2 | #define LIBPLDM_SRC_TRANSPORT_TRANSPORT_H |
Rashmica Gupta | c1b66f4 | 2022-12-09 16:24:45 +1100 | [diff] [blame] | 3 | |
| 4 | #include "libpldm/base.h" |
| 5 | #include "libpldm/requester/pldm.h" |
| 6 | struct 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 | */ |
| 17 | struct pldm_transport { |
| 18 | const char *name; |
| 19 | uint8_t version; |
| 20 | pldm_requester_rc_t (*recv)(struct pldm_transport *transport, |
Rashmica Gupta | 2457629 | 2023-07-31 14:02:41 +1000 | [diff] [blame] | 21 | pldm_tid_t *tid, void **pldm_resp_msg, |
Rashmica Gupta | f1ebde4 | 2023-07-31 14:17:57 +1000 | [diff] [blame] | 22 | size_t *msg_len); |
Rashmica Gupta | c1b66f4 | 2022-12-09 16:24:45 +1100 | [diff] [blame] | 23 | pldm_requester_rc_t (*send)(struct pldm_transport *transport, |
Rashmica Gupta | f1ebde4 | 2023-07-31 14:17:57 +1000 | [diff] [blame] | 24 | pldm_tid_t tid, const void *pldm_msg, |
| 25 | size_t msg_len); |
Rashmica Gupta | c1b66f4 | 2022-12-09 16:24:45 +1100 | [diff] [blame] | 26 | int (*init_pollfd)(struct pldm_transport *transport, |
| 27 | struct pollfd *pollfd); |
| 28 | }; |
| 29 | |
Rashmica Gupta | 8022323 | 2023-06-19 14:10:14 +1000 | [diff] [blame] | 30 | #endif // LIBPLDM_SRC_TRANSPORT_TRANSPORT_H |