Struct etherparse::TcpHeaderSlice[][src]

pub struct TcpHeaderSlice<'a> { /* fields omitted */ }
Expand description

A slice containing an tcp header of a network package.

Implementations

Creates a slice containing an tcp header.

Returns the slice containing the tcp header

Read the destination port number.

Read the destination port number.

Read the sequence number of the first data octet in this segment (except when SYN is present).

If SYN is present the sequence number is the initial sequence number (ISN) and the first data octet is ISN+1. [copied from RFC 793, page 16]

Reads the acknowledgment number.

If the ACK control bit is set this field contains the value of the next sequence number the sender of the segment is expecting to receive.

Once a connection is established this is always sent.

Read the number of 32 bit words in the TCP Header.

This indicates where the data begins. The TCP header (even one including options) is an integral number of 32 bits long.

ECN-nonce - concealment protection (experimental: see RFC 3540)

Read the fin flag (no more data from sender).

Reads the syn flag (synchronize sequence numbers).

Reads the rst flag (reset the connection).

Reads the psh flag (push function).

Reads the ack flag (acknowledgment field significant).

Reads the urg flag (Urgent Pointer field significant).

Read the ECN-Echo flag (RFC 3168).

Reads the cwr flag (Congestion Window Reduced).

This flag is set by the sending host to indicate that it received a TCP segment with the ECE flag set and had responded in congestion control mechanism (added to header by RFC 3168).

The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept.

Checksum (16 bit one’s complement) of the pseudo ip header, this tcp header and the payload.

This field communicates the current value of the urgent pointer as a positive offset from the sequence number in this segment.

The urgent pointer points to the sequence number of the octet following the urgent data. This field is only be interpreted in segments with the URG control bit set.

Options of the header

Returns an iterator that allows to iterate through all known TCP header options.

Decode all the fields and copy the results to a TcpHeader struct

Calculates the upd header checksum based on a ipv4 header and returns the result. This does NOT set the checksum.

Calculates the checksum for the current header in ipv4 mode and returns the result. This does NOT set the checksum.

Calculates the upd header checksum based on a ipv6 header and returns the result. This does NOT set the checksum..

Calculates the checksum for the current header in ipv6 mode and returns the result. This does NOT set the checksum.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.