Struct smoltcp::wire::TcpRepr [−][src]
A high-level representation of a Transmission Control Protocol packet.
Fields
src_port: u16
dst_port: u16
control: Control
seq_number: SeqNumber
ack_number: Option<SeqNumber>
window_len: u16
window_scale: Option<u8>
max_seg_size: Option<u16>
sack_permitted: bool
sack_ranges: [Option<(u32, u32)>; 3]
payload: &'a [u8]
Implementations
impl<'a> Repr<'a>
[src]
pub fn parse<T: ?Sized>(
packet: &Packet<&'a T>,
src_addr: &IpAddress,
dst_addr: &IpAddress,
checksum_caps: &ChecksumCapabilities
) -> Result<Repr<'a>> where
T: AsRef<[u8]>,
[src]
packet: &Packet<&'a T>,
src_addr: &IpAddress,
dst_addr: &IpAddress,
checksum_caps: &ChecksumCapabilities
) -> Result<Repr<'a>> where
T: AsRef<[u8]>,
Parse a Transmission Control Protocol packet and return a high-level representation.
pub fn header_len(&self) -> usize
[src]
Return the length of a header that will be emitted from this high-level representation.
This should be used for buffer space calculations. The TCP header length is a multiple of 4.
pub fn mss_header_len(&self) -> usize
[src]
Return the length of the header for the TCP protocol.
Per RFC 6691, this should be used for MSS calculations. It may be smaller than the buffer space required to accomodate this packet’s data.
pub fn buffer_len(&self) -> usize
[src]
Return the length of a packet that will be emitted from this high-level representation.
pub fn emit<T: ?Sized>(
&self,
packet: &mut Packet<&mut T>,
src_addr: &IpAddress,
dst_addr: &IpAddress,
checksum_caps: &ChecksumCapabilities
) where
T: AsRef<[u8]> + AsMut<[u8]>,
[src]
&self,
packet: &mut Packet<&mut T>,
src_addr: &IpAddress,
dst_addr: &IpAddress,
checksum_caps: &ChecksumCapabilities
) where
T: AsRef<[u8]> + AsMut<[u8]>,
Emit a high-level representation into a Transmission Control Protocol packet.
pub fn segment_len(&self) -> usize
[src]
Return the length of the segment, in terms of sequence space.
pub fn is_empty(&self) -> bool
[src]
Return whether the segment has no flags set (except PSH) and no data.
Trait Implementations
impl<'a> Clone for Repr<'a>
[src]
impl<'a> Copy for Repr<'a>
[src]
impl<'a> Debug for Repr<'a>
[src]
impl<'a> Display for Repr<'a>
[src]
impl<'a> Eq for Repr<'a>
[src]
impl<'a> PartialEq<Repr<'a>> for Repr<'a>
[src]
impl<'a> StructuralEq for Repr<'a>
[src]
impl<'a> StructuralPartialEq for Repr<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Repr<'a>
impl<'a> Send for Repr<'a>
impl<'a> Sync for Repr<'a>
impl<'a> Unpin for Repr<'a>
impl<'a> UnwindSafe for Repr<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,