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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 // QuicVersionToString. | 339 // QuicVersionToString. |
340 enum QuicVersion { | 340 enum QuicVersion { |
341 // Special case to indicate unknown/unsupported QUIC version. | 341 // Special case to indicate unknown/unsupported QUIC version. |
342 QUIC_VERSION_UNSUPPORTED = 0, | 342 QUIC_VERSION_UNSUPPORTED = 0, |
343 | 343 |
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 QUIC_VERSION_28 = 28, // Receiver can refuse to create a requested stream. |
| 349 QUIC_VERSION_29 = 29, // Server and client honor QUIC_STREAM_NO_ERROR. |
349 }; | 350 }; |
350 | 351 |
351 // This vector contains QUIC versions which we currently support. | 352 // This vector contains QUIC versions which we currently support. |
352 // This should be ordered such that the highest supported version is the first | 353 // This should be ordered such that the highest supported version is the first |
353 // element, with subsequent elements in descending order (versions can be | 354 // element, with subsequent elements in descending order (versions can be |
354 // skipped as necessary). | 355 // skipped as necessary). |
355 // | 356 // |
356 // IMPORTANT: if you are adding to this list, follow the instructions at | 357 // IMPORTANT: if you are adding to this list, follow the instructions at |
357 // http://sites/quic/adding-and-removing-versions | 358 // http://sites/quic/adding-and-removing-versions |
358 static const QuicVersion kSupportedQuicVersions[] = { | 359 static const QuicVersion kSupportedQuicVersions[] = { |
359 QUIC_VERSION_28, QUIC_VERSION_27, QUIC_VERSION_26, QUIC_VERSION_25}; | 360 QUIC_VERSION_29, QUIC_VERSION_28, QUIC_VERSION_27, QUIC_VERSION_26, |
| 361 QUIC_VERSION_25}; |
360 | 362 |
361 typedef std::vector<QuicVersion> QuicVersionVector; | 363 typedef std::vector<QuicVersion> QuicVersionVector; |
362 | 364 |
363 // Returns a vector of QUIC versions in kSupportedQuicVersions. | 365 // Returns a vector of QUIC versions in kSupportedQuicVersions. |
364 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); | 366 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); |
365 | 367 |
366 // QuicTag is written to and read from the wire, but we prefer to use | 368 // QuicTag is written to and read from the wire, but we prefer to use |
367 // the more readable QuicVersion at other levels. | 369 // the more readable QuicVersion at other levels. |
368 // Helper function which translates from a QuicVersion to a QuicTag. Returns 0 | 370 // Helper function which translates from a QuicVersion to a QuicTag. Returns 0 |
369 // if QuicVersion is unsupported. | 371 // if QuicVersion is unsupported. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 GetStartOfFecProtectedData(QuicConnectionIdLength connection_id_length, | 413 GetStartOfFecProtectedData(QuicConnectionIdLength connection_id_length, |
412 bool include_version, | 414 bool include_version, |
413 QuicPacketNumberLength packet_number_length); | 415 QuicPacketNumberLength packet_number_length); |
414 // Index of the first byte in a QUIC packet of encrypted data. | 416 // Index of the first byte in a QUIC packet of encrypted data. |
415 NET_EXPORT_PRIVATE size_t | 417 NET_EXPORT_PRIVATE size_t |
416 GetStartOfEncryptedData(QuicConnectionIdLength connection_id_length, | 418 GetStartOfEncryptedData(QuicConnectionIdLength connection_id_length, |
417 bool include_version, | 419 bool include_version, |
418 QuicPacketNumberLength packet_number_length); | 420 QuicPacketNumberLength packet_number_length); |
419 | 421 |
420 enum QuicRstStreamErrorCode { | 422 enum QuicRstStreamErrorCode { |
| 423 // Complete response has been sent, sending a RST to ask the other endpoint |
| 424 // to stop sending request data without discarding the response. |
421 QUIC_STREAM_NO_ERROR = 0, | 425 QUIC_STREAM_NO_ERROR = 0, |
422 | 426 |
423 // There was some error which halted stream processing. | 427 // There was some error which halted stream processing. |
424 QUIC_ERROR_PROCESSING_STREAM, | 428 QUIC_ERROR_PROCESSING_STREAM, |
425 // We got two fin or reset offsets which did not match. | 429 // We got two fin or reset offsets which did not match. |
426 QUIC_MULTIPLE_TERMINATION_OFFSETS, | 430 QUIC_MULTIPLE_TERMINATION_OFFSETS, |
427 // We got bad payload and can not respond to it at the protocol level. | 431 // We got bad payload and can not respond to it at the protocol level. |
428 QUIC_BAD_APPLICATION_PAYLOAD, | 432 QUIC_BAD_APPLICATION_PAYLOAD, |
429 // Stream closed due to connection error. No reset frame is sent when this | 433 // Stream closed due to connection error. No reset frame is sent when this |
430 // happens. | 434 // happens. |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 : iov(iov), iov_count(iov_count), total_length(total_length) {} | 1217 : iov(iov), iov_count(iov_count), total_length(total_length) {} |
1214 | 1218 |
1215 const struct iovec* iov; | 1219 const struct iovec* iov; |
1216 const int iov_count; | 1220 const int iov_count; |
1217 const size_t total_length; | 1221 const size_t total_length; |
1218 }; | 1222 }; |
1219 | 1223 |
1220 } // namespace net | 1224 } // namespace net |
1221 | 1225 |
1222 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1226 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |