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

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

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

Methods

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

Wrap a buffer with a TCP packet. Returns an error if the buffer is too small to contain one.

Consumes the packet, returning the underlying buffer.

Return the source port field.

Return the destination port field.

Return the sequence number field.

Return the acknowledgement number field.

Return the FIN flag.

Return the SYN flag.

Return the RST flag.

Return the PSH flag.

Return the ACK flag.

Return the URG flag.

Return the ECE flag.

Return the CWR flag.

Return the NS flag.

Return the header length, in octets.

Return the window size field.

Return the checksum field.

Return the urgent pointer field.

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

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.

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

Return a pointer to the payload.

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

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 FIN flag.

Set the SYN flag.

Set the RST flag.

Set the PSH flag.

Set the ACK flag.

Set the URG flag.

Set the ECE flag.

Set the CWR flag.

Set the NS flag.

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.

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

Return a mutable pointer to the payload data.

Trait Implementations

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

Formats the value using the given formatter.

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

Formats the value using the given formatter.

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

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