Changes in uspace/srv/net/tl/tcp/tcp_header.h [ede63e4:aadf01e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/tcp_header.h
rede63e4 raadf01e 43 43 /** TCP header size in bytes. 44 44 */ 45 #define TCP_HEADER_SIZE sizeof( tcp_header_t)45 #define TCP_HEADER_SIZE sizeof(tcp_header_t) 46 46 47 47 /** Returns the actual TCP header length in bytes. 48 48 * @param[in] header The TCP packet header. 49 49 */ 50 #define TCP_HEADER_LENGTH( header ) (( header )->header_length * 4u)50 #define TCP_HEADER_LENGTH(header) ((header)->header_length * 4u) 51 51 52 52 /** Returns the TCP header length. 53 53 * @param[in] length The TCP header length in bytes. 54 54 */ 55 #define TCP_COMPUTE_HEADER_LENGTH( length ) (( uint8_t ) (( length ) / 4u))55 #define TCP_COMPUTE_HEADER_LENGTH(length) ((uint8_t) ((length) / 4u)) 56 56 57 57 /** Type definition of the transmission datagram header. … … 90 90 /** The source port number. 91 91 */ 92 uint16_t 92 uint16_t source_port; 93 93 /** The destination port number. 94 94 */ 95 uint16_t 95 uint16_t destination_port; 96 96 /** The sequence number of the first data octet in this segment (except when SYN is present). 97 97 * If SYN is present the sequence number is the initial sequence number (ISN) and the first data octet is ISN+1. 98 98 */ 99 uint32_t 99 uint32_t sequence_number; 100 100 /** 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. 101 101 * Once a~connection is established this is always sent. 102 102 * @see acknowledge 103 103 */ 104 uint32_t 104 uint32_t acknowledgement_number; 105 105 #ifdef ARCH_IS_BIG_ENDIAN 106 106 /** The number of 32~bit words in the TCP Header. … … 108 108 * The TCP header (even one including options) is an integral number of 32~bits long. 109 109 */ 110 uint8_t 110 uint8_t header_length:4; 111 111 /** Four bits reserved for future use. 112 112 * Must be zero. 113 113 */ 114 uint8_t 114 uint8_t reserved1:4; 115 115 #else 116 116 /** Four bits reserved for future use. 117 117 * Must be zero. 118 118 */ 119 uint8_t 119 uint8_t reserved1:4; 120 120 /** The number of 32~bit words in the TCP Header. 121 121 * This indicates where the data begins. 122 122 * The TCP header (even one including options) is an integral number of 32~bits long. 123 123 */ 124 uint8_t 124 uint8_t header_length:4; 125 125 #endif 126 126 #ifdef ARCH_IS_BIG_ENDIAN … … 128 128 * Must be zero. 129 129 */ 130 uint8_t 130 uint8_t reserved2:2; 131 131 /** Urgent Pointer field significant. 132 132 * @see tcp_header:urgent_pointer 133 133 */ 134 uint8_t 134 uint8_t urgent:1; 135 135 /** Acknowledgment field significant 136 136 * @see tcp_header:acknowledgement_number 137 137 */ 138 uint8_t 138 uint8_t acknowledge:1; 139 139 /** Push function. 140 140 */ 141 uint8_t 141 uint8_t push:1; 142 142 /** Reset the connection. 143 143 */ 144 uint8_t 144 uint8_t reset:1; 145 145 /** Synchronize the sequence numbers. 146 146 */ 147 uint8_t 147 uint8_t synchronize:1; 148 148 /** No more data from the sender. 149 149 */ 150 uint8_t 150 uint8_t finalize:1; 151 151 #else 152 152 /** No more data from the sender. 153 153 */ 154 uint8_t 154 uint8_t finalize:1; 155 155 /** Synchronize the sequence numbers. 156 156 */ 157 uint8_t 157 uint8_t synchronize:1; 158 158 /** Reset the connection. 159 159 */ 160 uint8_t 160 uint8_t reset:1; 161 161 /** Push function. 162 162 */ 163 uint8_t 163 uint8_t push:1; 164 164 /** Acknowledgment field significant. 165 165 * @see tcp_header:acknowledgement_number 166 166 */ 167 uint8_t 167 uint8_t acknowledge:1; 168 168 /** Urgent Pointer field significant. 169 169 * @see tcp_header:urgent_pointer 170 170 */ 171 uint8_t 171 uint8_t urgent:1; 172 172 /** Two bits reserved for future use. 173 173 * Must be zero. 174 174 */ 175 uint8_t 175 uint8_t reserved2:2; 176 176 #endif 177 177 /** The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept. 178 178 * @see tcp_header:acknowledge 179 179 */ 180 uint16_t 180 uint16_t window; 181 181 /** 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. 182 182 * 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. … … 188 188 * If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic). 189 189 */ 190 uint16_t 190 uint16_t checksum; 191 191 /** This field communicates the current value of the urgent pointer as a~positive offset from the sequence number in this segment. 192 192 * The urgent pointer points to the sequence number of the octet following the urgent data. … … 194 194 * @see tcp_header:urgent 195 195 */ 196 uint16_t 196 uint16_t urgent_pointer; 197 197 } __attribute__ ((packed)); 198 198 … … 202 202 /** Option type. 203 203 */ 204 uint8_t 204 uint8_t type; 205 205 /** Option length. 206 206 */ 207 uint8_t 207 uint8_t length; 208 208 }; 209 209 … … 215 215 * @see TCPOPT_MAX_SEGMENT_SIZE_LENGTH 216 216 */ 217 tcp_option_t 217 tcp_option_t option; 218 218 /** Maximum segment size in bytes. 219 219 */ 220 uint16_t 220 uint16_t max_segment_size; 221 221 } __attribute__ ((packed)); 222 222
Note:
See TracChangeset
for help on using the changeset viewer.