Struct smoltcp::wire::TcpPacket [−][src]
Expand description
A read/write wrapper around a Transmission Control Protocol packet buffer.
Implementations
Imbue a raw octet buffer with TCP packet structure.
Shorthand for a combination of new_unchecked and check_len.
Ensure that no accessor method will panic if called.
Returns Err(Error::Truncated)
if the buffer is too short.
Returns Err(Error::Malformed)
if the header length field has a value smaller
than the minimal header length.
The result of this check is invalidated by calling set_header_len.
Consume the packet, returning the underlying buffer.
Return the sequence number field.
Return the acknowledgement number field.
Return the header length, in octets.
Return the window size field.
Return the length of the segment, in terms of sequence space.
Returns whether the selective acknowledgement SYN flag is set or not.
Return the selective acknowledgement ranges, if any. If there are none in the packet, an
array of None
values will be returned.
Return a pointer to the options.
Set the source port field.
Set the destination port field.
Set the sequence number field.
Set the acknowledgement number field.
Clear the entire flags field.
Set the header length, in octets.
Return the window size field.
Set the checksum field.
Set the urgent pointer field.
Compute and fill in the header checksum.
Panics
This function panics unless src_addr
and dst_addr
belong to the same family,
and that family is IPv4 or IPv6.
Return a pointer to the options.
Trait Implementations
fn pretty_print(
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
fn pretty_print(
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
Write a concise, formatted representation of a packet contained in the provided buffer, and any nested packets it may contain. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Packet<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Packet<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more