Struct smoltcp::wire::TcpPacket [] [src]

pub struct TcpPacket<T: AsRef<[u8]>> { /* fields omitted */ }

A read/write wrapper around a Transmission Control Protocol packet buffer.

Methods

impl<T: AsRef<[u8]>> Packet<T>
[src]

[src]

Imbue a raw octet buffer with TCP packet structure.

[src]

Shorthand for a combination of new and check_len.

[src]

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.

[src]

Consume the packet, returning the underlying buffer.

[src]

Return the source port field.

[src]

Return the destination port field.

[src]

Return the sequence number field.

[src]

Return the acknowledgement number field.

[src]

Return the FIN flag.

[src]

Return the SYN flag.

[src]

Return the RST flag.

[src]

Return the PSH flag.

[src]

Return the ACK flag.

[src]

Return the URG flag.

[src]

Return the ECE flag.

[src]

Return the CWR flag.

[src]

Return the NS flag.

[src]

Return the header length, in octets.

[src]

Return the window size field.

[src]

Return the checksum field.

[src]

Return the urgent pointer field.

[src]

Return the length of the segment, in terms of sequence space.

[src]

Validate the packet checksum.

Panics

This function panics unless src_addr and dst_addr belong to the same family, and that family is IPv4 or IPv6.

Fuzzing

This function always returns true when fuzzing.

impl<'a, T: AsRef<[u8]> + ?Sized> Packet<&'a T>
[src]

[src]

Return a pointer to the options.

[src]

Return a pointer to the payload.

impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T>
[src]

[src]

Set the source port field.

[src]

Set the destination port field.

[src]

Set the sequence number field.

[src]

Set the acknowledgement number field.

[src]

Clear the entire flags field.

[src]

Set the FIN flag.

[src]

Set the SYN flag.

[src]

Set the RST flag.

[src]

Set the PSH flag.

[src]

Set the ACK flag.

[src]

Set the URG flag.

[src]

Set the ECE flag.

[src]

Set the CWR flag.

[src]

Set the NS flag.

[src]

Set the header length, in octets.

[src]

Return the window size field.

[src]

Set the checksum field.

[src]

Set the urgent pointer field.

[src]

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.

impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Packet<&'a mut T>
[src]

[src]

Return a pointer to the options.

[src]

Return a mutable pointer to the payload data.

Trait Implementations

impl<T: Debug + AsRef<[u8]>> Debug for Packet<T>
[src]

[src]

Formats the value using the given formatter.

impl<'a, T: AsRef<[u8]> + ?Sized> Display for Packet<&'a T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: AsRef<[u8]>> PrettyPrint for Packet<T>
[src]

[src]

Write a concise, formatted representation of a packet contained in the provided buffer, and any nested packets it may contain. Read more