Transmission datagram header. More...
#include <tcp_header.h>
Data Fields | |
uint16_t | source_port |
The source port number. | |
uint16_t | destination_port |
The destination port number. | |
uint32_t | sequence_number |
The sequence number of the first data octet in this segment (except when SYN is present). | |
uint32_t | acknowledgement_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. | |
uint8_t | reserved1:4 |
Four bits reserved for future use. | |
uint8_t | header_length:4 |
The number of 32~bit words in the TCP Header. | |
uint8_t | finalize:1 |
No more data from the sender. | |
uint8_t | synchronize:1 |
Synchronize the sequence numbers. | |
uint8_t | reset:1 |
Reset the connection. | |
uint8_t | push:1 |
Push function. | |
uint8_t | acknowledge:1 |
Acknowledgment field significant. | |
uint8_t | urgent:1 |
Urgent Pointer field significant. | |
uint8_t | reserved2:2 |
Two bits reserved for future use. | |
uint16_t | window |
The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept. | |
uint16_t | checksum |
The checksum field is the 16~bit one's complement of the one's complement sum of all 16~bit words in the header and text. | |
uint16_t | urgent_pointer |
This field communicates the current value of the urgent pointer as a~positive offset from the sequence number in this segment. |
Transmission datagram header.
uint8_t tcp_header::acknowledge |
Acknowledgment field significant.
Referenced by tcp_process_acknowledgement(), tcp_process_syn_received(), and tcp_send_prepare_packet().
uint32_t tcp_header::acknowledgement_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.
Referenced by tcp_process_acknowledgement(), and tcp_send_prepare_packet().
uint16_t tcp_header::checksum |
The checksum field is the 16~bit one's complement of the one's complement sum of all 16~bit words in the header and text.
If a~segment contains an odd number of header and text octets to be checksummed, the last octet is padded on the right with zeros to form a~16~bit word for checksum purposes. The pad is not transmitted as part of the segment. While computing the checksum, the checksum field itself is replaced with zeros. The checksum also coves a~pseudo header conceptually. The pseudo header conceptually prefixed to the TCP header contains the source address, the destination address, the protocol, and the TCP length. This information gives protection against misrouted datagrams. If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic).
Referenced by tcp_process_packet(), and tcp_send_prepare_packet().
uint16_t tcp_header::destination_port |
The destination port number.
Referenced by tcp_process_packet(), and tcp_queue_prepare_packet().
uint8_t tcp_header::finalize |
No more data from the sender.
Referenced by tcp_prepare_operation_header(), tcp_process_established(), and tcp_queue_prepare_packet().
uint8_t tcp_header::header_length |
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.
Referenced by tcp_prepare_operation_header().
uint8_t tcp_header::push |
Push function.
uint8_t tcp_header::reserved1 |
Four bits reserved for future use.
Must be zero.
uint8_t tcp_header::reserved2 |
Two bits reserved for future use.
Must be zero.
uint8_t tcp_header::reset |
Reset the connection.
uint32_t tcp_header::sequence_number |
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.
Referenced by tcp_process_established(), tcp_process_listen(), tcp_process_syn_received(), tcp_process_syn_sent(), tcp_queue_prepare_packet(), and tcp_send_prepare_packet().
uint16_t tcp_header::source_port |
The source port number.
Referenced by tcp_prepare_operation_header(), tcp_process_listen(), tcp_process_packet(), and tcp_queue_prepare_packet().
uint8_t tcp_header::synchronize |
Synchronize the sequence numbers.
Referenced by tcp_prepare_operation_header(), tcp_process_listen(), and tcp_process_syn_sent().
uint8_t tcp_header::urgent |
Urgent Pointer field significant.
uint16_t tcp_header::urgent_pointer |
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.
uint16_t tcp_header::window |
The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept.
Referenced by tcp_process_acknowledgement(), tcp_process_listen(), and tcp_send_prepare_packet().