| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // The available versions of QUIC. Guaranteed that the integer value of the enum | 246 // The available versions of QUIC. Guaranteed that the integer value of the enum |
| 247 // will match the version number. | 247 // will match the version number. |
| 248 // When adding a new version to this enum you should add it to | 248 // When adding a new version to this enum you should add it to |
| 249 // kSupportedQuicVersions (if appropriate), and also add a new case to the | 249 // kSupportedQuicVersions (if appropriate), and also add a new case to the |
| 250 // helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and | 250 // helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and |
| 251 // QuicVersionToString. | 251 // QuicVersionToString. |
| 252 enum QuicVersion { | 252 enum QuicVersion { |
| 253 // Special case to indicate unknown/unsupported QUIC version. | 253 // Special case to indicate unknown/unsupported QUIC version. |
| 254 QUIC_VERSION_UNSUPPORTED = 0, | 254 QUIC_VERSION_UNSUPPORTED = 0, |
| 255 | 255 |
| 256 QUIC_VERSION_12 = 12, | |
| 257 QUIC_VERSION_13 = 13, | 256 QUIC_VERSION_13 = 13, |
| 258 QUIC_VERSION_14 = 14, | 257 QUIC_VERSION_14 = 14, |
| 259 QUIC_VERSION_15 = 15, | 258 QUIC_VERSION_15 = 15, |
| 260 QUIC_VERSION_16 = 16, // Current version. | 259 QUIC_VERSION_16 = 16, // Current version. |
| 261 }; | 260 }; |
| 262 | 261 |
| 263 // This vector contains QUIC versions which we currently support. | 262 // This vector contains QUIC versions which we currently support. |
| 264 // This should be ordered such that the highest supported version is the first | 263 // This should be ordered such that the highest supported version is the first |
| 265 // element, with subsequent elements in descending order (versions can be | 264 // element, with subsequent elements in descending order (versions can be |
| 266 // skipped as necessary). | 265 // skipped as necessary). |
| 267 // | 266 // |
| 268 // IMPORTANT: if you are addding to this list, follow the instructions at | 267 // IMPORTANT: if you are addding to this list, follow the instructions at |
| 269 // http://sites/quic/adding-and-removing-versions | 268 // http://sites/quic/adding-and-removing-versions |
| 270 static const QuicVersion kSupportedQuicVersions[] = {QUIC_VERSION_16, | 269 static const QuicVersion kSupportedQuicVersions[] = {QUIC_VERSION_16, |
| 271 QUIC_VERSION_15, | 270 QUIC_VERSION_15, |
| 272 QUIC_VERSION_14, | 271 QUIC_VERSION_14, |
| 273 QUIC_VERSION_13, | 272 QUIC_VERSION_13}; |
| 274 QUIC_VERSION_12}; | |
| 275 | 273 |
| 276 typedef std::vector<QuicVersion> QuicVersionVector; | 274 typedef std::vector<QuicVersion> QuicVersionVector; |
| 277 | 275 |
| 278 // Returns a vector of QUIC versions in kSupportedQuicVersions. | 276 // Returns a vector of QUIC versions in kSupportedQuicVersions. |
| 279 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); | 277 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); |
| 280 | 278 |
| 281 // QuicTag is written to and read from the wire, but we prefer to use | 279 // QuicTag is written to and read from the wire, but we prefer to use |
| 282 // the more readable QuicVersion at other levels. | 280 // the more readable QuicVersion at other levels. |
| 283 // Helper function which translates from a QuicVersion to a QuicTag. Returns 0 | 281 // Helper function which translates from a QuicVersion to a QuicTag. Returns 0 |
| 284 // if QuicVersion is unsupported. | 282 // if QuicVersion is unsupported. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 // A stream ID was invalid. | 400 // A stream ID was invalid. |
| 403 QUIC_INVALID_STREAM_ID = 17, | 401 QUIC_INVALID_STREAM_ID = 17, |
| 404 // A priority was invalid. | 402 // A priority was invalid. |
| 405 QUIC_INVALID_PRIORITY = 49, | 403 QUIC_INVALID_PRIORITY = 49, |
| 406 // Too many streams already open. | 404 // Too many streams already open. |
| 407 QUIC_TOO_MANY_OPEN_STREAMS = 18, | 405 QUIC_TOO_MANY_OPEN_STREAMS = 18, |
| 408 // Received public reset for this connection. | 406 // Received public reset for this connection. |
| 409 QUIC_PUBLIC_RESET = 19, | 407 QUIC_PUBLIC_RESET = 19, |
| 410 // Invalid protocol version. | 408 // Invalid protocol version. |
| 411 QUIC_INVALID_VERSION = 20, | 409 QUIC_INVALID_VERSION = 20, |
| 412 // Stream reset before headers decompressed. | 410 |
| 413 QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED = 21, | 411 // deprecated: QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED = 21 |
| 412 |
| 414 // The Header ID for a stream was too far from the previous. | 413 // The Header ID for a stream was too far from the previous. |
| 415 QUIC_INVALID_HEADER_ID = 22, | 414 QUIC_INVALID_HEADER_ID = 22, |
| 416 // Negotiable parameter received during handshake had invalid value. | 415 // Negotiable parameter received during handshake had invalid value. |
| 417 QUIC_INVALID_NEGOTIATED_VALUE = 23, | 416 QUIC_INVALID_NEGOTIATED_VALUE = 23, |
| 418 // There was an error decompressing data. | 417 // There was an error decompressing data. |
| 419 QUIC_DECOMPRESSION_FAILURE = 24, | 418 QUIC_DECOMPRESSION_FAILURE = 24, |
| 420 // We hit our prenegotiated (or default) timeout | 419 // We hit our prenegotiated (or default) timeout |
| 421 QUIC_CONNECTION_TIMED_OUT = 25, | 420 QUIC_CONNECTION_TIMED_OUT = 25, |
| 422 // There was an error encountered migrating addresses | 421 // There was an error encountered migrating addresses |
| 423 QUIC_ERROR_MIGRATING_ADDRESS = 26, | 422 QUIC_ERROR_MIGRATING_ADDRESS = 26, |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 WriteStatus status; | 1011 WriteStatus status; |
| 1013 union { | 1012 union { |
| 1014 int bytes_written; // only valid when status is OK | 1013 int bytes_written; // only valid when status is OK |
| 1015 int error_code; // only valid when status is ERROR | 1014 int error_code; // only valid when status is ERROR |
| 1016 }; | 1015 }; |
| 1017 }; | 1016 }; |
| 1018 | 1017 |
| 1019 } // namespace net | 1018 } // namespace net |
| 1020 | 1019 |
| 1021 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1020 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
| OLD | NEW |