| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // The available versions of QUIC. Guaranteed that the integer value of the enum | 361 // The available versions of QUIC. Guaranteed that the integer value of the enum |
| 362 // will match the version number. | 362 // will match the version number. |
| 363 // When adding a new version to this enum you should add it to | 363 // When adding a new version to this enum you should add it to |
| 364 // kSupportedQuicVersions (if appropriate), and also add a new case to the | 364 // kSupportedQuicVersions (if appropriate), and also add a new case to the |
| 365 // helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and | 365 // helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and |
| 366 // QuicVersionToString. | 366 // QuicVersionToString. |
| 367 enum QuicVersion { | 367 enum QuicVersion { |
| 368 // Special case to indicate unknown/unsupported QUIC version. | 368 // Special case to indicate unknown/unsupported QUIC version. |
| 369 QUIC_VERSION_UNSUPPORTED = 0, | 369 QUIC_VERSION_UNSUPPORTED = 0, |
| 370 | 370 |
| 371 QUIC_VERSION_30 = 30, // Add server side support of cert transparency. | |
| 372 QUIC_VERSION_31 = 31, // Adds a hash of the client hello to crypto proof. | |
| 373 QUIC_VERSION_32 = 32, // FEC related fields are removed from wire format. | 371 QUIC_VERSION_32 = 32, // FEC related fields are removed from wire format. |
| 374 QUIC_VERSION_33 = 33, // Adds diversification nonces. | 372 QUIC_VERSION_33 = 33, // Adds diversification nonces. |
| 375 QUIC_VERSION_34 = 34, // Deprecates entropy, removes private flag from packet | 373 QUIC_VERSION_34 = 34, // Deprecates entropy, removes private flag from packet |
| 376 // header, uses new ack and stop waiting wire format. | 374 // header, uses new ack and stop waiting wire format. |
| 377 QUIC_VERSION_35 = 35, // Allows endpoints to independently set stream limit. | 375 QUIC_VERSION_35 = 35, // Allows endpoints to independently set stream limit. |
| 378 QUIC_VERSION_36 = 36, // Add support to force HOL blocking. | 376 QUIC_VERSION_36 = 36, // Add support to force HOL blocking. |
| 379 | 377 |
| 380 // IMPORTANT: if you are adding to this std::list, follow the instructions at | 378 // IMPORTANT: if you are adding to this std::list, follow the instructions at |
| 381 // http://sites/quic/adding-and-removing-versions | 379 // http://sites/quic/adding-and-removing-versions |
| 382 }; | 380 }; |
| 383 | 381 |
| 384 // This vector contains QUIC versions which we currently support. | 382 // This vector contains QUIC versions which we currently support. |
| 385 // This should be ordered such that the highest supported version is the first | 383 // This should be ordered such that the highest supported version is the first |
| 386 // element, with subsequent elements in descending order (versions can be | 384 // element, with subsequent elements in descending order (versions can be |
| 387 // skipped as necessary). | 385 // skipped as necessary). |
| 388 // | 386 // |
| 389 // IMPORTANT: if you are adding to this list, follow the instructions at | 387 // IMPORTANT: if you are adding to this list, follow the instructions at |
| 390 // http://sites/quic/adding-and-removing-versions | 388 // http://sites/quic/adding-and-removing-versions |
| 391 static const QuicVersion kSupportedQuicVersions[] = { | 389 static const QuicVersion kSupportedQuicVersions[] = { |
| 392 QUIC_VERSION_36, QUIC_VERSION_35, QUIC_VERSION_34, QUIC_VERSION_33, | 390 QUIC_VERSION_36, QUIC_VERSION_35, QUIC_VERSION_34, QUIC_VERSION_33, |
| 393 QUIC_VERSION_32, QUIC_VERSION_31, QUIC_VERSION_30}; | 391 QUIC_VERSION_32}; |
| 394 | 392 |
| 395 typedef std::vector<QuicVersion> QuicVersionVector; | 393 typedef std::vector<QuicVersion> QuicVersionVector; |
| 396 | 394 |
| 397 // Returns a vector of QUIC versions in kSupportedQuicVersions. | 395 // Returns a vector of QUIC versions in kSupportedQuicVersions. |
| 398 NET_EXPORT_PRIVATE QuicVersionVector AllSupportedVersions(); | 396 NET_EXPORT_PRIVATE QuicVersionVector AllSupportedVersions(); |
| 399 | 397 |
| 400 // Returns a vector of QUIC versions from kSupportedQuicVersions which exclude | 398 // Returns a vector of QUIC versions from kSupportedQuicVersions which exclude |
| 401 // any versions which are disabled by flags. | 399 // any versions which are disabled by flags. |
| 402 NET_EXPORT_PRIVATE QuicVersionVector CurrentSupportedVersions(); | 400 NET_EXPORT_PRIVATE QuicVersionVector CurrentSupportedVersions(); |
| 403 | 401 |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1398 // Used to generate filtered supported versions based on flags. | 1396 // Used to generate filtered supported versions based on flags. |
| 1399 class NET_EXPORT_PRIVATE QuicVersionManager { | 1397 class NET_EXPORT_PRIVATE QuicVersionManager { |
| 1400 public: | 1398 public: |
| 1401 explicit QuicVersionManager(QuicVersionVector supported_versions); | 1399 explicit QuicVersionManager(QuicVersionVector supported_versions); |
| 1402 ~QuicVersionManager(); | 1400 ~QuicVersionManager(); |
| 1403 | 1401 |
| 1404 // Returns supported versions based on flags. | 1402 // Returns supported versions based on flags. |
| 1405 const QuicVersionVector& GetSupportedVersions(); | 1403 const QuicVersionVector& GetSupportedVersions(); |
| 1406 | 1404 |
| 1407 private: | 1405 private: |
| 1408 // FLAGS_quic_disable_pre_32 | |
| 1409 bool disable_pre_32_; | |
| 1410 // FLAGS_quic_disable_pre_34 | 1406 // FLAGS_quic_disable_pre_34 |
| 1411 bool disable_pre_34_; | 1407 bool disable_pre_34_; |
| 1412 // FLAGS_quic_enable_version_35 | 1408 // FLAGS_quic_enable_version_35 |
| 1413 bool enable_version_35_; | 1409 bool enable_version_35_; |
| 1414 // FLAGS_quic_enable_version_36_v2 | 1410 // FLAGS_quic_enable_version_36_v2 |
| 1415 bool enable_version_36_; | 1411 bool enable_version_36_; |
| 1416 // The list of versions that may be supported. | 1412 // The list of versions that may be supported. |
| 1417 QuicVersionVector allowed_supported_versions_; | 1413 QuicVersionVector allowed_supported_versions_; |
| 1418 // This vector contains QUIC versions which are currently supported based | 1414 // This vector contains QUIC versions which are currently supported based |
| 1419 // on flags. | 1415 // on flags. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 : iov(iov), iov_count(iov_count), total_length(total_length) {} | 1540 : iov(iov), iov_count(iov_count), total_length(total_length) {} |
| 1545 | 1541 |
| 1546 const struct iovec* iov; | 1542 const struct iovec* iov; |
| 1547 const int iov_count; | 1543 const int iov_count; |
| 1548 const size_t total_length; | 1544 const size_t total_length; |
| 1549 }; | 1545 }; |
| 1550 | 1546 |
| 1551 } // namespace net | 1547 } // namespace net |
| 1552 | 1548 |
| 1553 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1549 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
| OLD | NEW |