Rev 4750 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4750 | Rev 4756 | ||
|---|---|---|---|
| Line 31... | Line 31... | ||
| 31 | */ |
31 | */ |
| 32 | 32 | ||
| 33 | /** @file |
33 | /** @file |
| 34 | * TCP module implementation. |
34 | * TCP module implementation. |
| 35 | * @see tcp.h |
35 | * @see tcp.h |
| 36 | * \todo |
- | |
| 37 | */ |
36 | */ |
| 38 | 37 | ||
| 39 | #include <assert.h> |
38 | #include <assert.h> |
| 40 | #include <async.h> |
39 | #include <async.h> |
| 41 | #include <fibril_sync.h> |
40 | #include <fibril_sync.h> |
| Line 79... | Line 78... | ||
| 79 | 78 | ||
| 80 | /** The TCP window default value. |
79 | /** The TCP window default value. |
| 81 | */ |
80 | */ |
| 82 | #define NET_DEFAULT_TCP_WINDOW 10240 |
81 | #define NET_DEFAULT_TCP_WINDOW 10240 |
| 83 | 82 | ||
| 84 | /** \todo |
83 | /** Initial timeout for new connections. |
| 85 | */ |
84 | */ |
| 86 | #define NET_DEFAULT_TCP_INITIAL_TIMEOUT 3000000L |
85 | #define NET_DEFAULT_TCP_INITIAL_TIMEOUT 3000000L |
| 87 | 86 | ||
| 88 | /** \todo |
87 | /** Default timeout for closing. |
| 89 | */ |
88 | */ |
| 90 | #define NET_DEFAULT_TCP_TIME_WAIT_TIMEOUT 2000L |
89 | #define NET_DEFAULT_TCP_TIME_WAIT_TIMEOUT 2000L |
| 91 | 90 | ||
| 92 | /** The initial outgoing sequence number. |
91 | /** The initial outgoing sequence number. |
| 93 | */ |
92 | */ |
| Line 103... | Line 102... | ||
| 103 | 102 | ||
| 104 | /** Free ports pool end. |
103 | /** Free ports pool end. |
| 105 | */ |
104 | */ |
| 106 | #define TCP_FREE_PORTS_END 65535 |
105 | #define TCP_FREE_PORTS_END 65535 |
| 107 | 106 | ||
| 108 | /** \todo |
107 | /** Timeout for connection initialization, SYN sent. |
| 109 | */ |
108 | */ |
| 110 | #define TCP_SYN_SENT_TIMEOUT 1000000L |
109 | #define TCP_SYN_SENT_TIMEOUT 1000000L |
| 111 | 110 | ||
| 112 | /** The maximum number of timeouts in a row before singaling connection lost. |
111 | /** The maximum number of timeouts in a row before singaling connection lost. |
| 113 | */ |
112 | */ |
| Line 115... | Line 114... | ||
| 115 | 114 | ||
| 116 | /** The number of acknowledgements before retransmit. |
115 | /** The number of acknowledgements before retransmit. |
| 117 | */ |
116 | */ |
| 118 | #define TCP_FAST_RETRANSMIT_COUNT 3 |
117 | #define TCP_FAST_RETRANSMIT_COUNT 3 |
| 119 | 118 | ||
| - | 119 | /** Returns a value indicating whether the value is in the interval respecting the possible overflow. |
|
| - | 120 | * The high end and/or the value may overflow, be lower than the low value. |
|
| - | 121 | * @param[in] lower The last value before the interval. |
|
| 120 | /** \todo |
122 | * @param[in] value The value to be checked. |
| - | 123 | * @param[in] high_equal The last value in the interval. |
|
| 121 | */ |
124 | */ |
| 122 | #define IS_IN_INTERVAL_OVERFLOW( lower, value, higher_equal ) (((( lower ) < ( value )) && ((( value ) <= ( higher_equal )) || (( higher_equal ) < ( lower )))) || ((( value ) <= ( higher_equal )) && (( higher_equal ) < ( lower )))) |
125 | #define IS_IN_INTERVAL_OVERFLOW( lower, value, higher_equal ) (((( lower ) < ( value )) && ((( value ) <= ( higher_equal )) || (( higher_equal ) < ( lower )))) || ((( value ) <= ( higher_equal )) && (( higher_equal ) < ( lower )))) |
| 123 | 126 | ||
| 124 | /** Type definition of the TCP timeout. |
127 | /** Type definition of the TCP timeout. |
| 125 | * @see tcp_timeout |
128 | * @see tcp_timeout |
| Line 164... | Line 167... | ||
| 164 | */ |
167 | */ |
| 165 | size_t key_length; |
168 | size_t key_length; |
| 166 | }; |
169 | }; |
| 167 | 170 | ||
| 168 | /** Releases the packet and returns the result. |
171 | /** Releases the packet and returns the result. |
| 169 | * @param packet The packet queue to be released. Input parameter. |
172 | * @param[in] packet The packet queue to be released. |
| 170 | * @param result The result to be returned. Input parameter. |
173 | * @param[in] result The result to be returned. |
| 171 | * @return The result parameter. |
174 | * @return The result parameter. |
| 172 | */ |
175 | */ |
| 173 | int tcp_release_and_return( packet_t packet, int result ); |
176 | int tcp_release_and_return( packet_t packet, int result ); |
| 174 | 177 | ||
| 175 | void tcp_prepare_operation_header( socket_core_ref socket, tcp_socket_data_ref socket_data, tcp_header_ref header, int synchronize, int finalize ); |
178 | void tcp_prepare_operation_header( socket_core_ref socket, tcp_socket_data_ref socket_data, tcp_header_ref header, int synchronize, int finalize ); |