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 #include <limits> | 10 #include <limits> |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 // QuicVersionToString. | 338 // QuicVersionToString. |
339 enum QuicVersion { | 339 enum QuicVersion { |
340 // Special case to indicate unknown/unsupported QUIC version. | 340 // Special case to indicate unknown/unsupported QUIC version. |
341 QUIC_VERSION_UNSUPPORTED = 0, | 341 QUIC_VERSION_UNSUPPORTED = 0, |
342 | 342 |
343 QUIC_VERSION_24 = 24, // SPDY/4 header compression. | 343 QUIC_VERSION_24 = 24, // SPDY/4 header compression. |
344 QUIC_VERSION_25 = 25, // SPDY/4 header keys, and removal of error_details | 344 QUIC_VERSION_25 = 25, // SPDY/4 header keys, and removal of error_details |
345 // from QuicRstStreamFrame | 345 // from QuicRstStreamFrame |
346 QUIC_VERSION_26 = 26, // In CHLO, send XLCT tag containing hash of leaf cert | 346 QUIC_VERSION_26 = 26, // In CHLO, send XLCT tag containing hash of leaf cert |
347 QUIC_VERSION_27 = 27, // Sends a nonce in the SHLO. | 347 QUIC_VERSION_27 = 27, // Sends a nonce in the SHLO. |
| 348 QUIC_VERSION_28 = 28, // Receiver can refuse to create a requested stream. |
348 }; | 349 }; |
349 | 350 |
350 // This vector contains QUIC versions which we currently support. | 351 // This vector contains QUIC versions which we currently support. |
351 // This should be ordered such that the highest supported version is the first | 352 // This should be ordered such that the highest supported version is the first |
352 // element, with subsequent elements in descending order (versions can be | 353 // element, with subsequent elements in descending order (versions can be |
353 // skipped as necessary). | 354 // skipped as necessary). |
354 // | 355 // |
355 // IMPORTANT: if you are adding to this list, follow the instructions at | 356 // IMPORTANT: if you are adding to this list, follow the instructions at |
356 // http://sites/quic/adding-and-removing-versions | 357 // http://sites/quic/adding-and-removing-versions |
357 static const QuicVersion kSupportedQuicVersions[] = { | 358 static const QuicVersion kSupportedQuicVersions[] = { |
358 QUIC_VERSION_27, QUIC_VERSION_26, QUIC_VERSION_25, QUIC_VERSION_24}; | 359 QUIC_VERSION_28, QUIC_VERSION_27, QUIC_VERSION_26, QUIC_VERSION_25, |
| 360 QUIC_VERSION_24}; |
359 | 361 |
360 typedef std::vector<QuicVersion> QuicVersionVector; | 362 typedef std::vector<QuicVersion> QuicVersionVector; |
361 | 363 |
362 // Returns a vector of QUIC versions in kSupportedQuicVersions. | 364 // Returns a vector of QUIC versions in kSupportedQuicVersions. |
363 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); | 365 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); |
364 | 366 |
365 // QuicTag is written to and read from the wire, but we prefer to use | 367 // QuicTag is written to and read from the wire, but we prefer to use |
366 // the more readable QuicVersion at other levels. | 368 // the more readable QuicVersion at other levels. |
367 // Helper function which translates from a QuicVersion to a QuicTag. Returns 0 | 369 // Helper function which translates from a QuicVersion to a QuicTag. Returns 0 |
368 // if QuicVersion is unsupported. | 370 // if QuicVersion is unsupported. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 // Stream closed due to connection error. No reset frame is sent when this | 430 // Stream closed due to connection error. No reset frame is sent when this |
429 // happens. | 431 // happens. |
430 QUIC_STREAM_CONNECTION_ERROR, | 432 QUIC_STREAM_CONNECTION_ERROR, |
431 // GoAway frame sent. No more stream can be created. | 433 // GoAway frame sent. No more stream can be created. |
432 QUIC_STREAM_PEER_GOING_AWAY, | 434 QUIC_STREAM_PEER_GOING_AWAY, |
433 // The stream has been cancelled. | 435 // The stream has been cancelled. |
434 QUIC_STREAM_CANCELLED, | 436 QUIC_STREAM_CANCELLED, |
435 // Closing stream locally, sending a RST to allow for proper flow control | 437 // Closing stream locally, sending a RST to allow for proper flow control |
436 // accounting. Sent in response to a RST from the peer. | 438 // accounting. Sent in response to a RST from the peer. |
437 QUIC_RST_ACKNOWLEDGEMENT, | 439 QUIC_RST_ACKNOWLEDGEMENT, |
| 440 // Receiver refused to create the stream (because its limit on open streams |
| 441 // has been reached). The sender should retry the request later (using |
| 442 // another stream). |
| 443 QUIC_REFUSED_STREAM, |
438 | 444 |
439 // No error. Used as bound while iterating. | 445 // No error. Used as bound while iterating. |
440 QUIC_STREAM_LAST_ERROR, | 446 QUIC_STREAM_LAST_ERROR, |
441 }; | 447 }; |
442 | 448 |
443 // Because receiving an unknown QuicRstStreamErrorCode results in connection | 449 // Because receiving an unknown QuicRstStreamErrorCode results in connection |
444 // teardown, we use this to make sure any errors predating a given version are | 450 // teardown, we use this to make sure any errors predating a given version are |
445 // downgraded to the most appropriate existing error. | 451 // downgraded to the most appropriate existing error. |
446 NET_EXPORT_PRIVATE QuicRstStreamErrorCode AdjustErrorForVersion( | 452 NET_EXPORT_PRIVATE QuicRstStreamErrorCode AdjustErrorForVersion( |
447 QuicRstStreamErrorCode error_code, | 453 QuicRstStreamErrorCode error_code, |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 : iov(iov), iov_count(iov_count), total_length(total_length) {} | 1204 : iov(iov), iov_count(iov_count), total_length(total_length) {} |
1199 | 1205 |
1200 const struct iovec* iov; | 1206 const struct iovec* iov; |
1201 const int iov_count; | 1207 const int iov_count; |
1202 const size_t total_length; | 1208 const size_t total_length; |
1203 }; | 1209 }; |
1204 | 1210 |
1205 } // namespace net | 1211 } // namespace net |
1206 | 1212 |
1207 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1213 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |