Rashmica Gupta | c1b66f4 | 2022-12-09 16:24:45 +1100 | [diff] [blame] | 1 | #ifndef TRANSPORT_H |
| 2 | #define TRANSPORT_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
| 8 | #include "libpldm/base.h" |
| 9 | #include "libpldm/requester/pldm.h" |
| 10 | struct 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 | */ |
| 21 | struct 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 |