#[repr(u8)]pub enum PacketType {
Sync = 83,
Connect = 67,
Reset = 82,
Accept = 65,
Data = 68,
}
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.
Connect = 67
Connect to a cid:port pair from a cid:port pair on the other side. 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 may contain an initial data packet for the connection.
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.
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