Struct penguin_mux::StreamFrame
source · #[repr(C)]pub struct StreamFrame {
pub sport: u16,
pub dport: u16,
pub flag: StreamFlag,
pub data: Bytes,
}
Expand description
Stream frame.
See PROTOCOL.md for details.
Fields§
§sport: u16
Source port (2 bytes)
dport: u16
Destination port (2 bytes)
flag: StreamFlag
Frame type (1 byte)
data: Bytes
Data
Implementations§
source§impl StreamFrame
impl StreamFrame
sourcepub fn new_syn(dest_host: &[u8], dest_port: u16, sport: u16, rwnd: u64) -> Self
pub fn new_syn(dest_host: &[u8], dest_port: u16, sport: u16, rwnd: u64) -> Self
Create a new StreamFlag::Syn
frame.
Arguments
dest_host
: The destination host to forward to.dest_port
: The destination port to forward to.sport
: The source port of this stream.rwnd
: Number of frames buffered in the client receive buffer.
sourcepub fn new_synack(sport: u16, dport: u16, rwnd: u64) -> Self
pub fn new_synack(sport: u16, dport: u16, rwnd: u64) -> Self
Create a new StreamFlag::SynAck
frame.
Arguments
sport
: The source port of this stream.dport
: The destination port of this stream (i.e. the source port of theSyn
frame).rwnd
: Number of frames buffered in the server receive buffer.
sourcepub fn new_ack(sport: u16, dport: u16, psh_recvd_since: u64) -> Self
pub fn new_ack(sport: u16, dport: u16, psh_recvd_since: u64) -> Self
Create a new StreamFlag::Ack
frame.
Arguments
sport
: The source port of this stream.dport
: The destination port of this stream.psh_recvd_since
: The number ofPsh
frames received since the previousAck
frame.
sourcepub const fn new_rst(sport: u16, dport: u16) -> Self
pub const fn new_rst(sport: u16, dport: u16) -> Self
Create a new StreamFlag::Rst
frame.
Arguments
sport
: The destination port of the offending frame.dport
: The source port of the offending frame.
Trait Implementations§
source§impl Clone for StreamFrame
impl Clone for StreamFrame
source§fn clone(&self) -> StreamFrame
fn clone(&self) -> StreamFrame
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for StreamFrame
impl Debug for StreamFrame
source§impl From<StreamFrame> for Message
impl From<StreamFrame> for Message
source§fn from(frame: StreamFrame) -> Self
fn from(frame: StreamFrame) -> Self
Converts to this type from the input type.
source§impl From<StreamFrame> for Vec<u8>
impl From<StreamFrame> for Vec<u8>
source§fn from(frame: StreamFrame) -> Self
fn from(frame: StreamFrame) -> Self
Convert a StreamFrame
to bytes.
source§impl PartialEq for StreamFrame
impl PartialEq for StreamFrame
source§fn eq(&self, other: &StreamFrame) -> bool
fn eq(&self, other: &StreamFrame) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<Bytes> for StreamFrame
impl TryFrom<Bytes> for StreamFrame
impl Eq for StreamFrame
impl StructuralEq for StreamFrame
impl StructuralPartialEq for StreamFrame
Auto Trait Implementations§
impl RefUnwindSafe for StreamFrame
impl Send for StreamFrame
impl Sync for StreamFrame
impl Unpin for StreamFrame
impl UnwindSafe for StreamFrame
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more