Expand description
Interface for the Linux socket-based MCTP support.
This crate provides some minimal wrappers around standard libc
socket
operations, using MCTP-specific addressing structures.
MctpSocket
provides support for blocking socket operations
sendto, recvfrom
and
bind
.
use mctp_linux;
let sock = mctp_linux::MctpSocket::new()?;
let bind_addr = mctp_linux::MctpSockAddr::new(
mctp::MCTP_ADDR_ANY.0,
mctp_linux::MCTP_NET_ANY,
1,
0
);
sock.bind(&bind_addr)?;
let mut buf = [0; 64];
let (len, src) = sock.recvfrom(&mut buf)?;
MctpLinuxEp
provides a thin wrapper that represents a remote endpoint,
referenced by EID. It creates a single socket for communication with that
endpoint. This is a convenience for simple consumers that perform
single-endpoint communication; general MCTP requesters may want a different
socket model.
Structs§
- Mctp
Addr - Helper for applications taking an MCTP address as an argument, configuration, etc.
- Mctp
Linux Ep - Encapsulation of a remote endpoint: a socket and an Endpoint ID.
- Mctp
Sock Addr - Address information for a socket
- Mctp
Socket - MCTP socket object.
Constants§
- MCTP_
NET_ ANY - Special value for Network ID: any network. May be used in
bind()
.