Lines Matching full:demux
11 #include <libpldm/transport/mctp-demux.h>
23 #define MCTP_DEMUX_NAME "libmctp-demux-daemon"
132 struct pldm_transport_mctp_demux *demux = transport_to_demux(t); in pldm_transport_mctp_demux_recv() local
148 length = recv(demux->socket, NULL, 0, MSG_PEEK | MSG_TRUNC); in pldm_transport_mctp_demux_recv()
160 recv(demux->socket, buf, length, 0); in pldm_transport_mctp_demux_recv()
174 bytes = recvmsg(demux->socket, &msg, 0); in pldm_transport_mctp_demux_recv()
186 rc = pldm_transport_mctp_demux_get_tid(demux, eid, tid); in pldm_transport_mctp_demux_recv()
207 struct pldm_transport_mctp_demux *demux = transport_to_demux(t); in pldm_transport_mctp_demux_send() local
209 if (pldm_transport_mctp_demux_get_eid(demux, tid, &eid)) { in pldm_transport_mctp_demux_send()
226 pldm_socket_sndbuf_accomodate(&(demux->socket_send_buf), in pldm_transport_mctp_demux_send()
231 ssize_t rc = sendmsg(demux->socket, &msg, 0); in pldm_transport_mctp_demux_send()
245 struct pldm_transport_mctp_demux *demux = in pldm_transport_mctp_demux_init() local
247 if (!demux) { in pldm_transport_mctp_demux_init()
251 demux->transport.name = MCTP_DEMUX_NAME; in pldm_transport_mctp_demux_init()
252 demux->transport.version = 1; in pldm_transport_mctp_demux_init()
253 demux->transport.recv = pldm_transport_mctp_demux_recv; in pldm_transport_mctp_demux_init()
254 demux->transport.send = pldm_transport_mctp_demux_send; in pldm_transport_mctp_demux_init()
255 demux->transport.init_pollfd = pldm_transport_mctp_demux_init_pollfd; in pldm_transport_mctp_demux_init()
256 demux->socket = pldm_transport_mctp_demux_open(); in pldm_transport_mctp_demux_init()
257 if (demux->socket == -1) { in pldm_transport_mctp_demux_init()
258 free(demux); in pldm_transport_mctp_demux_init()
262 if (pldm_socket_sndbuf_init(&demux->socket_send_buf, demux->socket)) { in pldm_transport_mctp_demux_init()
263 close(demux->socket); in pldm_transport_mctp_demux_init()
264 free(demux); in pldm_transport_mctp_demux_init()
268 *ctx = demux; in pldm_transport_mctp_demux_init()
286 struct pldm_transport_mctp_demux *demux = in pldm_transport_mctp_demux_init_with_fd() local
288 if (!demux) { in pldm_transport_mctp_demux_init_with_fd()
292 demux->transport.name = MCTP_DEMUX_NAME; in pldm_transport_mctp_demux_init_with_fd()
293 demux->transport.version = 1; in pldm_transport_mctp_demux_init_with_fd()
294 demux->transport.recv = pldm_transport_mctp_demux_recv; in pldm_transport_mctp_demux_init_with_fd()
295 demux->transport.send = pldm_transport_mctp_demux_send; in pldm_transport_mctp_demux_init_with_fd()
296 demux->transport.init_pollfd = pldm_transport_mctp_demux_init_pollfd; in pldm_transport_mctp_demux_init_with_fd()
300 demux->socket = dup(mctp_fd); in pldm_transport_mctp_demux_init_with_fd()
301 if (demux->socket == -1) { in pldm_transport_mctp_demux_init_with_fd()
302 free(demux); in pldm_transport_mctp_demux_init_with_fd()
306 if (pldm_socket_sndbuf_init(&demux->socket_send_buf, demux->socket)) { in pldm_transport_mctp_demux_init_with_fd()
307 close(demux->socket); in pldm_transport_mctp_demux_init_with_fd()
308 free(demux); in pldm_transport_mctp_demux_init_with_fd()
312 return demux; in pldm_transport_mctp_demux_init_with_fd()