| 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 <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // Minimum size of initial flow control window, for both stream and session. | 71 // Minimum size of initial flow control window, for both stream and session. |
| 72 const uint32_t kMinimumFlowControlSendWindow = 16 * 1024; // 16 KB | 72 const uint32_t kMinimumFlowControlSendWindow = 16 * 1024; // 16 KB |
| 73 | 73 |
| 74 // Maximum flow control receive window limits for connection and stream. | 74 // Maximum flow control receive window limits for connection and stream. |
| 75 const QuicByteCount kStreamReceiveWindowLimit = 16 * 1024 * 1024; // 16 MB | 75 const QuicByteCount kStreamReceiveWindowLimit = 16 * 1024 * 1024; // 16 MB |
| 76 const QuicByteCount kSessionReceiveWindowLimit = 24 * 1024 * 1024; // 24 MB | 76 const QuicByteCount kSessionReceiveWindowLimit = 24 * 1024 * 1024; // 24 MB |
| 77 | 77 |
| 78 // Minimum size of the CWND, in packets, when doing bandwidth resumption. | 78 // Minimum size of the CWND, in packets, when doing bandwidth resumption. |
| 79 const QuicPacketCount kMinCongestionWindowForBandwidthResumption = 10; | 79 const QuicPacketCount kMinCongestionWindowForBandwidthResumption = 10; |
| 80 | 80 |
| 81 // Maximum size of the CWND, in packets. | |
| 82 const QuicPacketCount kMaxCongestionWindow = 200; | |
| 83 | |
| 84 // Maximum number of tracked packets. | 81 // Maximum number of tracked packets. |
| 85 const QuicPacketCount kMaxTrackedPackets = 5000; | 82 const QuicPacketCount kMaxTrackedPackets = 5000; |
| 86 | 83 |
| 87 // Default size of the socket receive buffer in bytes. | 84 // Default size of the socket receive buffer in bytes. |
| 88 const QuicByteCount kDefaultSocketReceiveBuffer = 256 * 1024; | 85 const QuicByteCount kDefaultSocketReceiveBuffer = 256 * 1024; |
| 89 // Minimum size of the socket receive buffer in bytes. | 86 // Minimum size of the socket receive buffer in bytes. |
| 90 // Smaller values are ignored. | 87 // Smaller values are ignored. |
| 91 const QuicByteCount kMinSocketReceiveBuffer = 16 * 1024; | 88 const QuicByteCount kMinSocketReceiveBuffer = 16 * 1024; |
| 92 | 89 |
| 93 // Fraction of the receive buffer that can be used for encrypted bytes. | 90 // Fraction of the receive buffer that can be used for encrypted bytes. |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 // FEC data is malformed. | 522 // FEC data is malformed. |
| 526 QUIC_INVALID_FEC_DATA = 5, | 523 QUIC_INVALID_FEC_DATA = 5, |
| 527 // STREAM frame data is malformed. | 524 // STREAM frame data is malformed. |
| 528 QUIC_INVALID_STREAM_DATA = 46, | 525 QUIC_INVALID_STREAM_DATA = 46, |
| 529 // STREAM frame data overlaps with buffered data. | 526 // STREAM frame data overlaps with buffered data. |
| 530 QUIC_OVERLAPPING_STREAM_DATA = 87, | 527 QUIC_OVERLAPPING_STREAM_DATA = 87, |
| 531 // Received STREAM frame data is not encrypted. | 528 // Received STREAM frame data is not encrypted. |
| 532 QUIC_UNENCRYPTED_STREAM_DATA = 61, | 529 QUIC_UNENCRYPTED_STREAM_DATA = 61, |
| 533 // Attempt to send unencrypted STREAM frame. | 530 // Attempt to send unencrypted STREAM frame. |
| 534 QUIC_ATTEMPT_TO_SEND_UNENCRYPTED_STREAM_DATA = 88, | 531 QUIC_ATTEMPT_TO_SEND_UNENCRYPTED_STREAM_DATA = 88, |
| 532 // Received a frame which is likely the result of memory corruption. |
| 533 QUIC_MAYBE_CORRUPTED_MEMORY = 89, |
| 535 // FEC frame data is not encrypted. | 534 // FEC frame data is not encrypted. |
| 536 QUIC_UNENCRYPTED_FEC_DATA = 77, | 535 QUIC_UNENCRYPTED_FEC_DATA = 77, |
| 537 // RST_STREAM frame data is malformed. | 536 // RST_STREAM frame data is malformed. |
| 538 QUIC_INVALID_RST_STREAM_DATA = 6, | 537 QUIC_INVALID_RST_STREAM_DATA = 6, |
| 539 // CONNECTION_CLOSE frame data is malformed. | 538 // CONNECTION_CLOSE frame data is malformed. |
| 540 QUIC_INVALID_CONNECTION_CLOSE_DATA = 7, | 539 QUIC_INVALID_CONNECTION_CLOSE_DATA = 7, |
| 541 // GOAWAY frame data is malformed. | 540 // GOAWAY frame data is malformed. |
| 542 QUIC_INVALID_GOAWAY_DATA = 8, | 541 QUIC_INVALID_GOAWAY_DATA = 8, |
| 543 // WINDOW_UPDATE frame data is malformed. | 542 // WINDOW_UPDATE frame data is malformed. |
| 544 QUIC_INVALID_WINDOW_UPDATE_DATA = 57, | 543 QUIC_INVALID_WINDOW_UPDATE_DATA = 57, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 QUIC_CONNECTION_MIGRATION_NO_MIGRATABLE_STREAMS = 81, | 690 QUIC_CONNECTION_MIGRATION_NO_MIGRATABLE_STREAMS = 81, |
| 692 // Connection changed networks too many times. | 691 // Connection changed networks too many times. |
| 693 QUIC_CONNECTION_MIGRATION_TOO_MANY_CHANGES = 82, | 692 QUIC_CONNECTION_MIGRATION_TOO_MANY_CHANGES = 82, |
| 694 // Connection migration was attempted, but there was no new network to | 693 // Connection migration was attempted, but there was no new network to |
| 695 // migrate to. | 694 // migrate to. |
| 696 QUIC_CONNECTION_MIGRATION_NO_NEW_NETWORK = 83, | 695 QUIC_CONNECTION_MIGRATION_NO_NEW_NETWORK = 83, |
| 697 // Network changed, but connection had one or more non-migratable streams. | 696 // Network changed, but connection had one or more non-migratable streams. |
| 698 QUIC_CONNECTION_MIGRATION_NON_MIGRATABLE_STREAM = 84, | 697 QUIC_CONNECTION_MIGRATION_NON_MIGRATABLE_STREAM = 84, |
| 699 | 698 |
| 700 // No error. Used as bound while iterating. | 699 // No error. Used as bound while iterating. |
| 701 QUIC_LAST_ERROR = 89, | 700 QUIC_LAST_ERROR = 90, |
| 702 }; | 701 }; |
| 703 | 702 |
| 704 // Must be updated any time a QuicErrorCode is deprecated. | 703 // Must be updated any time a QuicErrorCode is deprecated. |
| 705 const int kDeprecatedQuicErrorCount = 4; | 704 const int kDeprecatedQuicErrorCount = 4; |
| 706 const int kActiveQuicErrorCount = QUIC_LAST_ERROR - kDeprecatedQuicErrorCount; | 705 const int kActiveQuicErrorCount = QUIC_LAST_ERROR - kDeprecatedQuicErrorCount; |
| 707 | 706 |
| 708 typedef char DiversificationNonce[32]; | 707 typedef char DiversificationNonce[32]; |
| 709 | 708 |
| 710 struct NET_EXPORT_PRIVATE QuicPacketPublicHeader { | 709 struct NET_EXPORT_PRIVATE QuicPacketPublicHeader { |
| 711 QuicPacketPublicHeader(); | 710 QuicPacketPublicHeader(); |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 QuicFrames retransmittable_frames; | 1434 QuicFrames retransmittable_frames; |
| 1436 EncryptionLevel encryption_level; | 1435 EncryptionLevel encryption_level; |
| 1437 QuicPacketNumberLength packet_number_length; | 1436 QuicPacketNumberLength packet_number_length; |
| 1438 QuicPacketLength bytes_sent; | 1437 QuicPacketLength bytes_sent; |
| 1439 uint16_t nack_count; | 1438 uint16_t nack_count; |
| 1440 QuicTime sent_time; | 1439 QuicTime sent_time; |
| 1441 // Reason why this packet was transmitted. | 1440 // Reason why this packet was transmitted. |
| 1442 TransmissionType transmission_type; | 1441 TransmissionType transmission_type; |
| 1443 // In flight packets have not been abandoned or lost. | 1442 // In flight packets have not been abandoned or lost. |
| 1444 bool in_flight; | 1443 bool in_flight; |
| 1445 // True if the packet can never be acked, so it can be removed. | 1444 // True if the packet can never be acked, so it can be removed. Occurs when |
| 1445 // a packet is never sent, after it is acknowledged once, or if it's a crypto |
| 1446 // packet we never expect to receive an ack for. |
| 1446 bool is_unackable; | 1447 bool is_unackable; |
| 1447 // True if the packet contains stream data from the crypto stream. | 1448 // True if the packet contains stream data from the crypto stream. |
| 1448 bool has_crypto_handshake; | 1449 bool has_crypto_handshake; |
| 1449 // Non-zero if the packet needs padding if it's retransmitted. | 1450 // Non-zero if the packet needs padding if it's retransmitted. |
| 1450 int num_padding_bytes; | 1451 int num_padding_bytes; |
| 1451 // Stores the packet number of the next retransmission of this packet. | 1452 // Stores the packet number of the next retransmission of this packet. |
| 1452 // Zero if the packet has not been retransmitted. | 1453 // Zero if the packet has not been retransmitted. |
| 1453 QuicPacketNumber retransmission; | 1454 QuicPacketNumber retransmission; |
| 1454 // Non-empty if there is a listener for this packet. | 1455 // Non-empty if there is a listener for this packet. |
| 1455 std::list<AckListenerWrapper> ack_listeners; | 1456 std::list<AckListenerWrapper> ack_listeners; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 : iov(iov), iov_count(iov_count), total_length(total_length) {} | 1492 : iov(iov), iov_count(iov_count), total_length(total_length) {} |
| 1492 | 1493 |
| 1493 const struct iovec* iov; | 1494 const struct iovec* iov; |
| 1494 const int iov_count; | 1495 const int iov_count; |
| 1495 const size_t total_length; | 1496 const size_t total_length; |
| 1496 }; | 1497 }; |
| 1497 | 1498 |
| 1498 } // namespace net | 1499 } // namespace net |
| 1499 | 1500 |
| 1500 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1501 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
| OLD | NEW |