Module capsules_extra::net::udp

source ·

Re-exports§

Modules§

  • UDP userspace interface for transmit and receive.
  • In-kernel structure for tracking UDP ports bound by capsules.
  • This file contains the definition and implementation for the UDP reception interface. It follows the same virtualization model as that described in udp_send.rs, except that no queueing is needed because received packets are immediately dispatched to the appropriate capsule / app. Once again, port binding for userspace apps is managed separately by the UDP userspace driver, which must correctly check bindings of kernel apps to ensure correctness when dispatching received packets to the appropriate client.
  • This file contains the definition and implementation for a virtualized UDP sending interface. The UDPSender trait provides an interface for kernel capsules to send a UDP packet, and the UDPSendClient trait is implemented by upper layer clients to allow them to receive send_done callbacks once transmission has completed. In order to virtualize between both apps and kernel capsules, this file uses a MuxUdpSender which treats the userspace UDP driver as a kernel capsule with a special capability that allows it to bind to arbitrary ports. Therefore the correctness of port binding / packet transmission/delivery is also dependent on the port binding logic in the driver being correct. The MuxUdpSender acts as a FIFO queue for transmitted packets, with each capsule being allowed a single outstanding / unsent packet at a time. Because the userspace driver is viewed by the MuxUdpSender as being a single capsule, the userspace driver must queue app packets on its own, as it can only pass a single packet to the MuxUdpSender queue at a time.

Structs§

  • The UDPHeader struct follows the layout for the UDP packet header. Note that the implementation of this struct provides getters and setters for the various fields of the header, to avoid confusion with endian-ness.