#[repr(u8)]pub enum PacketType {
Sync = 83,
Echo = 69,
EchoReply = 101,
Connect = 67,
Finish = 70,
Reset = 82,
Accept = 65,
Data = 68,
Pause = 88,
}
Expand description
The serializable enumeration of packet types that can be used over a usb vsock link. These
roughly correspond to the state machine described by the fuchsia.hardware.vsock
fidl library.
Variants§
Sync = 83
Synchronizes the connection between host and device. Each side must send and receive a sync packet with the same payload before any other packet may be recognized on the usb connection. If this packet is received mid-stream, all connections must be considered reset to avoid data loss. It should also only ever be the last vsock packet in a given usb packet.
Echo = 69
An outbound echo request. The other end should reply to this with the same body and all the
same fields in a PacketType::EchoReply
packet, no matter the state of the connection.
EchoReply = 101
A reply to a PacketType::Echo
request packet. The body and all header fields should be
set the same as the original echo packet’s.
Connect = 67
Connect to a cid:port pair from a cid:port pair on the other side. The payload must be empty.
Finish = 70
Notify the other end that this connection should be closed. The other end should respond
with an PacketType::Reset
when the connection has been closed on the other end. The
payload must be empty.
Reset = 82
Terminate or refuse a connection on a particular cid:port pair set. There must have been a
previous PacketType::Connect
request for this, and after this that particular set of
pairs must be considered disconnected and no more PacketType::Data
packets may be sent
for it unless a new connection is initiated. The payload must be empty.
Accept = 65
Accepts a connection previously requested with PacketType::Connect
on the given cid:port
pair set. The payload must be empty.
Data = 68
A data packet for a particular cid:port pair set previously established with a PacketType::Connect
and PacketType::Accept
message. If all of the cid and port fields of the packet are
zero, this is for a special data stream between the host and device that does not require
an established connection.
Pause = 88
Advisory flow control message. Payload indicates flow control state “on” or “off”. If “on”, it is recommended that the receiver not send more data for this connection if possible, until the state becomes “off” again. State is assumed “off” when no packet has been received.
Trait Implementations§
Source§impl Clone for PacketType
impl Clone for PacketType
Source§fn clone(&self) -> PacketType
fn clone(&self) -> PacketType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PacketType
impl Debug for PacketType
Source§impl Hash for PacketType
impl Hash for PacketType
Source§impl IntoBytes for PacketType
impl IntoBytes for PacketType
Source§impl KnownLayout for PacketTypewhere
Self: Sized,
impl KnownLayout for PacketTypewhere
Self: Sized,
Source§type PointerMetadata = ()
type PointerMetadata = ()
Self
. Read more