| 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_VERSIONS_H_ | 5 #ifndef NET_QUIC_QUIC_VERSIONS_H_ |
| 6 #define NET_QUIC_QUIC_VERSIONS_H_ | 6 #define NET_QUIC_QUIC_VERSIONS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "net/quic/core/quic_types.h" | 11 #include "net/quic/core/quic_types.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 // The available versions of QUIC. Guaranteed that the integer value of the enum | 15 // The available versions of QUIC. Guaranteed that the integer value of the enum |
| 16 // will match the version number. | 16 // will match the version number. |
| 17 // When adding a new version to this enum you should add it to | 17 // When adding a new version to this enum you should add it to |
| 18 // kSupportedQuicVersions (if appropriate), and also add a new case to the | 18 // kSupportedQuicVersions (if appropriate), and also add a new case to the |
| 19 // helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and | 19 // helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and |
| 20 // QuicVersionToString. | 20 // QuicVersionToString. |
| 21 enum QuicVersion { | 21 enum QuicVersion { |
| 22 // Special case to indicate unknown/unsupported QUIC version. | 22 // Special case to indicate unknown/unsupported QUIC version. |
| 23 QUIC_VERSION_UNSUPPORTED = 0, | 23 QUIC_VERSION_UNSUPPORTED = 0, |
| 24 | 24 |
| 25 QUIC_VERSION_32 = 32, // FEC related fields are removed from wire format. | |
| 26 QUIC_VERSION_33 = 33, // Adds diversification nonces. | |
| 27 QUIC_VERSION_34 = 34, // Deprecates entropy, removes private flag from packet | 25 QUIC_VERSION_34 = 34, // Deprecates entropy, removes private flag from packet |
| 28 // header, uses new ack and stop waiting wire format. | 26 // header, uses new ack and stop waiting wire format. |
| 29 QUIC_VERSION_35 = 35, // Allows endpoints to independently set stream limit. | 27 QUIC_VERSION_35 = 35, // Allows endpoints to independently set stream limit. |
| 30 QUIC_VERSION_36 = 36, // Add support to force HOL blocking. | 28 QUIC_VERSION_36 = 36, // Add support to force HOL blocking. |
| 31 | 29 |
| 32 // IMPORTANT: if you are adding to this std::list, follow the instructions at | 30 // IMPORTANT: if you are adding to this std::list, follow the instructions at |
| 33 // http://sites/quic/adding-and-removing-versions | 31 // http://sites/quic/adding-and-removing-versions |
| 34 }; | 32 }; |
| 35 | 33 |
| 36 // This vector contains QUIC versions which we currently support. | 34 // This vector contains QUIC versions which we currently support. |
| 37 // This should be ordered such that the highest supported version is the first | 35 // This should be ordered such that the highest supported version is the first |
| 38 // element, with subsequent elements in descending order (versions can be | 36 // element, with subsequent elements in descending order (versions can be |
| 39 // skipped as necessary). | 37 // skipped as necessary). |
| 40 // | 38 // |
| 41 // IMPORTANT: if you are adding to this list, follow the instructions at | 39 // IMPORTANT: if you are adding to this list, follow the instructions at |
| 42 // http://sites/quic/adding-and-removing-versions | 40 // http://sites/quic/adding-and-removing-versions |
| 43 static const QuicVersion kSupportedQuicVersions[] = { | 41 static const QuicVersion kSupportedQuicVersions[] = { |
| 44 QUIC_VERSION_36, QUIC_VERSION_35, QUIC_VERSION_34, QUIC_VERSION_33, | 42 QUIC_VERSION_36, QUIC_VERSION_35, QUIC_VERSION_34}; |
| 45 QUIC_VERSION_32}; | |
| 46 | 43 |
| 47 typedef std::vector<QuicVersion> QuicVersionVector; | 44 typedef std::vector<QuicVersion> QuicVersionVector; |
| 48 | 45 |
| 49 // Returns a vector of QUIC versions in kSupportedQuicVersions. | 46 // Returns a vector of QUIC versions in kSupportedQuicVersions. |
| 50 NET_EXPORT_PRIVATE QuicVersionVector AllSupportedVersions(); | 47 NET_EXPORT_PRIVATE QuicVersionVector AllSupportedVersions(); |
| 51 | 48 |
| 52 // Returns a vector of QUIC versions from kSupportedQuicVersions which exclude | 49 // Returns a vector of QUIC versions from kSupportedQuicVersions which exclude |
| 53 // any versions which are disabled by flags. | 50 // any versions which are disabled by flags. |
| 54 NET_EXPORT_PRIVATE QuicVersionVector CurrentSupportedVersions(); | 51 NET_EXPORT_PRIVATE QuicVersionVector CurrentSupportedVersions(); |
| 55 | 52 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 78 NET_EXPORT_PRIVATE std::string QuicVersionToString(const QuicVersion version); | 75 NET_EXPORT_PRIVATE std::string QuicVersionToString(const QuicVersion version); |
| 79 | 76 |
| 80 // Returns comma separated list of string representations of QuicVersion enum | 77 // Returns comma separated list of string representations of QuicVersion enum |
| 81 // values in the supplied |versions| vector. | 78 // values in the supplied |versions| vector. |
| 82 NET_EXPORT_PRIVATE std::string QuicVersionVectorToString( | 79 NET_EXPORT_PRIVATE std::string QuicVersionVectorToString( |
| 83 const QuicVersionVector& versions); | 80 const QuicVersionVector& versions); |
| 84 | 81 |
| 85 } // namespace net | 82 } // namespace net |
| 86 | 83 |
| 87 #endif // NET_QUIC_QUIC_VERSIONS_H_ | 84 #endif // NET_QUIC_QUIC_VERSIONS_H_ |
| OLD | NEW |