| 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 <map> | 10 #include <map> |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 void NET_EXPORT_PRIVATE InsertMissingPacketsBetween( | 693 void NET_EXPORT_PRIVATE InsertMissingPacketsBetween( |
| 694 QuicAckFrame* ack_frame, | 694 QuicAckFrame* ack_frame, |
| 695 QuicPacketSequenceNumber lower, | 695 QuicPacketSequenceNumber lower, |
| 696 QuicPacketSequenceNumber higher); | 696 QuicPacketSequenceNumber higher); |
| 697 | 697 |
| 698 // Defines for all types of congestion feedback that will be negotiated in QUIC, | 698 // Defines for all types of congestion feedback that will be negotiated in QUIC, |
| 699 // kTCP MUST be supported by all QUIC implementations to guarantee 100% | 699 // kTCP MUST be supported by all QUIC implementations to guarantee 100% |
| 700 // compatibility. | 700 // compatibility. |
| 701 enum CongestionFeedbackType { | 701 enum CongestionFeedbackType { |
| 702 kTCP, // Used to mimic TCP. | 702 kTCP, // Used to mimic TCP. |
| 703 kInterArrival, // Use additional inter arrival information. | 703 kTimestamp, // Use additional inter arrival timestamp information. |
| 704 }; | 704 }; |
| 705 | 705 |
| 706 // Defines for all types of congestion control algorithms that can be used in | 706 // Defines for all types of congestion control algorithms that can be used in |
| 707 // QUIC. Note that this is separate from the congestion feedback type - | 707 // QUIC. Note that this is separate from the congestion feedback type - |
| 708 // some congestion control algorithms may use the same feedback type | 708 // some congestion control algorithms may use the same feedback type |
| 709 // (Reno and Cubic are the classic example for that). | 709 // (Reno and Cubic are the classic example for that). |
| 710 enum CongestionControlType { | 710 enum CongestionControlType { |
| 711 kCubic, | 711 kCubic, |
| 712 kReno, | 712 kReno, |
| 713 kBBR, | 713 kBBR, |
| 714 }; | 714 }; |
| 715 | 715 |
| 716 enum LossDetectionType { | 716 enum LossDetectionType { |
| 717 kNack, // Used to mimic TCP's loss detection. | 717 kNack, // Used to mimic TCP's loss detection. |
| 718 kTime, // Time based loss detection. | 718 kTime, // Time based loss detection. |
| 719 }; | 719 }; |
| 720 | 720 |
| 721 struct NET_EXPORT_PRIVATE CongestionFeedbackMessageTCP { | 721 struct NET_EXPORT_PRIVATE CongestionFeedbackMessageTCP { |
| 722 CongestionFeedbackMessageTCP(); | 722 CongestionFeedbackMessageTCP(); |
| 723 | 723 |
| 724 QuicByteCount receive_window; | 724 QuicByteCount receive_window; |
| 725 }; | 725 }; |
| 726 | 726 |
| 727 struct NET_EXPORT_PRIVATE CongestionFeedbackMessageInterArrival { | 727 struct NET_EXPORT_PRIVATE CongestionFeedbackMessageTimestamp { |
| 728 CongestionFeedbackMessageInterArrival(); | 728 CongestionFeedbackMessageTimestamp(); |
| 729 ~CongestionFeedbackMessageInterArrival(); | 729 ~CongestionFeedbackMessageTimestamp(); |
| 730 | 730 |
| 731 // The set of received packets since the last feedback was sent, along with | 731 // The set of received packets since the last feedback was sent, along with |
| 732 // their arrival times. | 732 // their arrival times. |
| 733 TimeMap received_packet_times; | 733 TimeMap received_packet_times; |
| 734 }; | 734 }; |
| 735 | 735 |
| 736 struct NET_EXPORT_PRIVATE QuicCongestionFeedbackFrame { | 736 struct NET_EXPORT_PRIVATE QuicCongestionFeedbackFrame { |
| 737 QuicCongestionFeedbackFrame(); | 737 QuicCongestionFeedbackFrame(); |
| 738 ~QuicCongestionFeedbackFrame(); | 738 ~QuicCongestionFeedbackFrame(); |
| 739 | 739 |
| 740 NET_EXPORT_PRIVATE friend std::ostream& operator<<( | 740 NET_EXPORT_PRIVATE friend std::ostream& operator<<( |
| 741 std::ostream& os, const QuicCongestionFeedbackFrame& c); | 741 std::ostream& os, const QuicCongestionFeedbackFrame& c); |
| 742 | 742 |
| 743 CongestionFeedbackType type; | 743 CongestionFeedbackType type; |
| 744 // This should really be a union, but since the inter arrival struct | 744 // This should really be a union, but since the timestamp struct |
| 745 // is non-trivial, C++ prohibits it. | 745 // is non-trivial, C++ prohibits it. |
| 746 CongestionFeedbackMessageTCP tcp; | 746 CongestionFeedbackMessageTCP tcp; |
| 747 CongestionFeedbackMessageInterArrival inter_arrival; | 747 CongestionFeedbackMessageTimestamp timestamp; |
| 748 }; | 748 }; |
| 749 | 749 |
| 750 struct NET_EXPORT_PRIVATE QuicRstStreamFrame { | 750 struct NET_EXPORT_PRIVATE QuicRstStreamFrame { |
| 751 QuicRstStreamFrame(); | 751 QuicRstStreamFrame(); |
| 752 QuicRstStreamFrame(QuicStreamId stream_id, | 752 QuicRstStreamFrame(QuicStreamId stream_id, |
| 753 QuicRstStreamErrorCode error_code, | 753 QuicRstStreamErrorCode error_code, |
| 754 QuicStreamOffset bytes_written); | 754 QuicStreamOffset bytes_written); |
| 755 | 755 |
| 756 NET_EXPORT_PRIVATE friend std::ostream& operator<<( | 756 NET_EXPORT_PRIVATE friend std::ostream& operator<<( |
| 757 std::ostream& os, const QuicRstStreamFrame& r); | 757 std::ostream& os, const QuicRstStreamFrame& r); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 // Stores the sequence numbers of all transmissions of this packet. | 1053 // Stores the sequence numbers of all transmissions of this packet. |
| 1054 // Can never be null. | 1054 // Can never be null. |
| 1055 SequenceNumberSet* all_transmissions; | 1055 SequenceNumberSet* all_transmissions; |
| 1056 // In flight packets have not been abandoned or lost. | 1056 // In flight packets have not been abandoned or lost. |
| 1057 bool in_flight; | 1057 bool in_flight; |
| 1058 }; | 1058 }; |
| 1059 | 1059 |
| 1060 } // namespace net | 1060 } // namespace net |
| 1061 | 1061 |
| 1062 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1062 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
| OLD | NEW |