OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ | 5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ |
6 #define NET_QUIC_QUIC_PROTOCOL_H_ | 6 #define NET_QUIC_QUIC_PROTOCOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <limits> | 9 #include <limits> |
10 #include <list> | 10 #include <list> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 const QuicByteCount kDefaultMaxPacketSize = 1350; | 53 const QuicByteCount kDefaultMaxPacketSize = 1350; |
54 // The maximum packet size of any QUIC packet, based on ethernet's max size, | 54 // The maximum packet size of any QUIC packet, based on ethernet's max size, |
55 // minus the IP and UDP headers. IPv6 has a 40 byte header, UPD adds an | 55 // minus the IP and UDP headers. IPv6 has a 40 byte header, UPD adds an |
56 // additional 8 bytes. This is a total overhead of 48 bytes. Ethernet's | 56 // additional 8 bytes. This is a total overhead of 48 bytes. Ethernet's |
57 // max packet size is 1500 bytes, 1500 - 48 = 1452. | 57 // max packet size is 1500 bytes, 1500 - 48 = 1452. |
58 const QuicByteCount kMaxPacketSize = 1452; | 58 const QuicByteCount kMaxPacketSize = 1452; |
59 // Default maximum packet size used in Linux TCP implementations. | 59 // Default maximum packet size used in Linux TCP implementations. |
60 const QuicByteCount kDefaultTCPMSS = 1460; | 60 const QuicByteCount kDefaultTCPMSS = 1460; |
61 | 61 |
62 // Maximum size of the initial congestion window in packets. | 62 // Maximum size of the initial congestion window in packets. |
63 const size_t kDefaultInitialWindow = 10; | 63 const QuicPacketCount kDefaultInitialWindow = 10; |
64 const uint32 kMaxInitialWindow = 100; | 64 const QuicPacketCount kMaxInitialWindow = 100; |
65 | 65 |
66 // Default size of initial flow control window, for both stream and session. | 66 // Default size of initial flow control window, for both stream and session. |
67 const uint32 kDefaultFlowControlSendWindow = 16 * 1024; // 16 KB | 67 const uint32 kDefaultFlowControlSendWindow = 16 * 1024; // 16 KB |
68 | 68 |
69 // Maximum size of the congestion window, in packets, for TCP congestion control | 69 // Maximum size of the congestion window, in packets, for TCP congestion control |
70 // algorithms. | 70 // algorithms. |
71 const size_t kMaxTcpCongestionWindow = 200; | 71 const size_t kMaxTcpCongestionWindow = 200; |
72 | 72 |
73 // Default size of the socket receive buffer in bytes. | 73 // Default size of the socket receive buffer in bytes. |
74 const QuicByteCount kDefaultSocketReceiveBuffer = 256 * 1024; | 74 const QuicByteCount kDefaultSocketReceiveBuffer = 256 * 1024; |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 QUIC_MULTIPLE_TERMINATION_OFFSETS, | 389 QUIC_MULTIPLE_TERMINATION_OFFSETS, |
390 // We got bad payload and can not respond to it at the protocol level. | 390 // We got bad payload and can not respond to it at the protocol level. |
391 QUIC_BAD_APPLICATION_PAYLOAD, | 391 QUIC_BAD_APPLICATION_PAYLOAD, |
392 // Stream closed due to connection error. No reset frame is sent when this | 392 // Stream closed due to connection error. No reset frame is sent when this |
393 // happens. | 393 // happens. |
394 QUIC_STREAM_CONNECTION_ERROR, | 394 QUIC_STREAM_CONNECTION_ERROR, |
395 // GoAway frame sent. No more stream can be created. | 395 // GoAway frame sent. No more stream can be created. |
396 QUIC_STREAM_PEER_GOING_AWAY, | 396 QUIC_STREAM_PEER_GOING_AWAY, |
397 // The stream has been cancelled. | 397 // The stream has been cancelled. |
398 QUIC_STREAM_CANCELLED, | 398 QUIC_STREAM_CANCELLED, |
399 // Sending a RST to allow for proper flow control accounting. | 399 // Closing stream locally, sending a RST to allow for proper flow control |
400 QUIC_RST_FLOW_CONTROL_ACCOUNTING, | 400 // accounting. Sent in response to a RST from the peer. |
| 401 QUIC_RST_ACKNOWLEDGEMENT, |
401 | 402 |
402 // No error. Used as bound while iterating. | 403 // No error. Used as bound while iterating. |
403 QUIC_STREAM_LAST_ERROR, | 404 QUIC_STREAM_LAST_ERROR, |
404 }; | 405 }; |
405 | 406 |
406 // Because receiving an unknown QuicRstStreamErrorCode results in connection | 407 // Because receiving an unknown QuicRstStreamErrorCode results in connection |
407 // teardown, we use this to make sure any errors predating a given version are | 408 // teardown, we use this to make sure any errors predating a given version are |
408 // downgraded to the most appropriate existing error. | 409 // downgraded to the most appropriate existing error. |
409 NET_EXPORT_PRIVATE QuicRstStreamErrorCode AdjustErrorForVersion( | 410 NET_EXPORT_PRIVATE QuicRstStreamErrorCode AdjustErrorForVersion( |
410 QuicRstStreamErrorCode error_code, | 411 QuicRstStreamErrorCode error_code, |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 SequenceNumberList* all_transmissions; | 1091 SequenceNumberList* all_transmissions; |
1091 // In flight packets have not been abandoned or lost. | 1092 // In flight packets have not been abandoned or lost. |
1092 bool in_flight; | 1093 bool in_flight; |
1093 // True if the packet can never be acked, so it can be removed. | 1094 // True if the packet can never be acked, so it can be removed. |
1094 bool is_unackable; | 1095 bool is_unackable; |
1095 }; | 1096 }; |
1096 | 1097 |
1097 } // namespace net | 1098 } // namespace net |
1098 | 1099 |
1099 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1100 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |