| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 // The available versions of QUIC. Guaranteed that the integer value of the enum | 266 // The available versions of QUIC. Guaranteed that the integer value of the enum |
| 267 // will match the version number. | 267 // will match the version number. |
| 268 // When adding a new version to this enum you should add it to | 268 // When adding a new version to this enum you should add it to |
| 269 // kSupportedQuicVersions (if appropriate), and also add a new case to the | 269 // kSupportedQuicVersions (if appropriate), and also add a new case to the |
| 270 // helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and | 270 // helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and |
| 271 // QuicVersionToString. | 271 // QuicVersionToString. |
| 272 enum QuicVersion { | 272 enum QuicVersion { |
| 273 // Special case to indicate unknown/unsupported QUIC version. | 273 // Special case to indicate unknown/unsupported QUIC version. |
| 274 QUIC_VERSION_UNSUPPORTED = 0, | 274 QUIC_VERSION_UNSUPPORTED = 0, |
| 275 | 275 |
| 276 QUIC_VERSION_15 = 15, // Revived packets in ReceivedPacketInfo. | |
| 277 QUIC_VERSION_16 = 16, // STOP_WAITING frame. | 276 QUIC_VERSION_16 = 16, // STOP_WAITING frame. |
| 278 QUIC_VERSION_18 = 18, // PING frame. | 277 QUIC_VERSION_18 = 18, // PING frame. |
| 279 QUIC_VERSION_19 = 19, // Connection level flow control. | 278 QUIC_VERSION_19 = 19, // Connection level flow control. |
| 280 QUIC_VERSION_20 = 20, // Independent stream/connection flow control windows. | 279 QUIC_VERSION_20 = 20, // Independent stream/connection flow control windows. |
| 281 QUIC_VERSION_21 = 21, // Headers/crypto streams are flow controlled. | 280 QUIC_VERSION_21 = 21, // Headers/crypto streams are flow controlled. |
| 282 }; | 281 }; |
| 283 | 282 |
| 284 // This vector contains QUIC versions which we currently support. | 283 // This vector contains QUIC versions which we currently support. |
| 285 // This should be ordered such that the highest supported version is the first | 284 // This should be ordered such that the highest supported version is the first |
| 286 // element, with subsequent elements in descending order (versions can be | 285 // element, with subsequent elements in descending order (versions can be |
| 287 // skipped as necessary). | 286 // skipped as necessary). |
| 288 // | 287 // |
| 289 // IMPORTANT: if you are addding to this list, follow the instructions at | 288 // IMPORTANT: if you are adding to this list, follow the instructions at |
| 290 // http://sites/quic/adding-and-removing-versions | 289 // http://sites/quic/adding-and-removing-versions |
| 291 static const QuicVersion kSupportedQuicVersions[] = {QUIC_VERSION_21, | 290 static const QuicVersion kSupportedQuicVersions[] = {QUIC_VERSION_21, |
| 292 QUIC_VERSION_20, | 291 QUIC_VERSION_20, |
| 293 QUIC_VERSION_19, | 292 QUIC_VERSION_19, |
| 294 QUIC_VERSION_18, | 293 QUIC_VERSION_18, |
| 295 QUIC_VERSION_16, | 294 QUIC_VERSION_16}; |
| 296 QUIC_VERSION_15}; | |
| 297 | 295 |
| 298 typedef std::vector<QuicVersion> QuicVersionVector; | 296 typedef std::vector<QuicVersion> QuicVersionVector; |
| 299 | 297 |
| 300 // Returns a vector of QUIC versions in kSupportedQuicVersions. | 298 // Returns a vector of QUIC versions in kSupportedQuicVersions. |
| 301 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); | 299 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); |
| 302 | 300 |
| 303 // QuicTag is written to and read from the wire, but we prefer to use | 301 // QuicTag is written to and read from the wire, but we prefer to use |
| 304 // the more readable QuicVersion at other levels. | 302 // the more readable QuicVersion at other levels. |
| 305 // Helper function which translates from a QuicVersion to a QuicTag. Returns 0 | 303 // Helper function which translates from a QuicVersion to a QuicTag. Returns 0 |
| 306 // if QuicVersion is unsupported. | 304 // if QuicVersion is unsupported. |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 // The lowest packet we've sent which is unacked, and we expect an ack for. | 695 // The lowest packet we've sent which is unacked, and we expect an ack for. |
| 698 QuicPacketSequenceNumber least_unacked; | 696 QuicPacketSequenceNumber least_unacked; |
| 699 }; | 697 }; |
| 700 | 698 |
| 701 struct NET_EXPORT_PRIVATE QuicAckFrame { | 699 struct NET_EXPORT_PRIVATE QuicAckFrame { |
| 702 QuicAckFrame(); | 700 QuicAckFrame(); |
| 703 | 701 |
| 704 NET_EXPORT_PRIVATE friend std::ostream& operator<<( | 702 NET_EXPORT_PRIVATE friend std::ostream& operator<<( |
| 705 std::ostream& os, const QuicAckFrame& s); | 703 std::ostream& os, const QuicAckFrame& s); |
| 706 | 704 |
| 707 QuicStopWaitingFrame sent_info; | 705 // TODO(ianswett): Inline the fields of received_info. |
| 708 ReceivedPacketInfo received_info; | 706 ReceivedPacketInfo received_info; |
| 709 }; | 707 }; |
| 710 | 708 |
| 711 // Defines for all types of congestion feedback that will be negotiated in QUIC, | 709 // Defines for all types of congestion feedback that will be negotiated in QUIC, |
| 712 // kTCP MUST be supported by all QUIC implementations to guarantee 100% | 710 // kTCP MUST be supported by all QUIC implementations to guarantee 100% |
| 713 // compatibility. | 711 // compatibility. |
| 714 enum CongestionFeedbackType { | 712 enum CongestionFeedbackType { |
| 715 kTCP, // Used to mimic TCP. | 713 kTCP, // Used to mimic TCP. |
| 716 kInterArrival, // Use additional inter arrival information. | 714 kInterArrival, // Use additional inter arrival information. |
| 717 kFixRate, // Provided for testing. | 715 kFixRate, // Provided for testing. |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 // Stores the sequence numbers of all transmissions of this packet. | 1072 // Stores the sequence numbers of all transmissions of this packet. |
| 1075 // Can never be null. | 1073 // Can never be null. |
| 1076 SequenceNumberSet* all_transmissions; | 1074 SequenceNumberSet* all_transmissions; |
| 1077 // In flight packets have not been abandoned or lost. | 1075 // In flight packets have not been abandoned or lost. |
| 1078 bool in_flight; | 1076 bool in_flight; |
| 1079 }; | 1077 }; |
| 1080 | 1078 |
| 1081 } // namespace net | 1079 } // namespace net |
| 1082 | 1080 |
| 1083 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1081 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
| OLD | NEW |