pub trait Client {
// Required methods
fn driver(&self) -> &dyn Driver;
fn recv(&mut self, data: &[u8], checksum: &ChecksumState);
fn rx_mtu(&mut self) -> usize;
}
Expand description
A consomme client.
Required Methods§
Sourcefn driver(&self) -> &dyn Driver
fn driver(&self) -> &dyn Driver
Gets the driver to use for handling new connections.
TODO: generalize connection creation to allow pluggable model (not just OS sockets) and remove this.
Sourcefn recv(&mut self, data: &[u8], checksum: &ChecksumState)
fn recv(&mut self, data: &[u8], checksum: &ChecksumState)
Transmits a packet to the client.
If checksum.ipv4
, checksum.tcp
, or checksum.udp
are set, then the
packet contains an IPv4 header, TCP header, and/or UDP header with a
valid checksum.
TODO:
- support >MTU sized packets (RSC/LRO/GRO)
- allow discontiguous data to eliminate the extra copy from the TCP window.