1 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
2 #ifndef LIBPLDM_DEMUX_H
3 #define LIBPLDM_DEMUX_H
4 
5 #include <libpldm/base.h>
6 #include <libpldm/pldm.h>
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 struct pldm_transport_mctp_demux;
13 
14 /* Init the transport backend */
15 int pldm_transport_mctp_demux_init(struct pldm_transport_mctp_demux **ctx);
16 
17 /* Destroy the transport backend */
18 void pldm_transport_mctp_demux_destroy(struct pldm_transport_mctp_demux *ctx);
19 
20 /* Get the core pldm transport struct */
21 struct pldm_transport *
22 pldm_transport_mctp_demux_core(struct pldm_transport_mctp_demux *ctx);
23 
24 #ifdef PLDM_HAS_POLL
25 struct pollfd;
26 /* Init pollfd for async calls */
27 int pldm_transport_mctp_demux_init_pollfd(struct pldm_transport *t,
28 					  struct pollfd *pollfd);
29 #endif
30 
31 /* Inserts a TID-to-EID mapping into the transport's device map */
32 int pldm_transport_mctp_demux_map_tid(struct pldm_transport_mctp_demux *ctx,
33 				      pldm_tid_t tid, mctp_eid_t eid);
34 
35 /* Removes a TID-to-EID mapping from the transport's device map */
36 int pldm_transport_mctp_demux_unmap_tid(struct pldm_transport_mctp_demux *ctx,
37 					pldm_tid_t tid, mctp_eid_t eid);
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 
43 #endif /* LIBPLDM_DEMUX_H */
44