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.