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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 QUIC_VERSION_26 = 26, // In CHLO, send XLCT tag containing hash of leaf cert | 364 QUIC_VERSION_26 = 26, // In CHLO, send XLCT tag containing hash of leaf cert |
365 QUIC_VERSION_27 = 27, // Sends a nonce in the SHLO. | 365 QUIC_VERSION_27 = 27, // Sends a nonce in the SHLO. |
366 QUIC_VERSION_28 = 28, // Receiver can refuse to create a requested stream. | 366 QUIC_VERSION_28 = 28, // Receiver can refuse to create a requested stream. |
367 QUIC_VERSION_29 = 29, // Server and client honor QUIC_STREAM_NO_ERROR. | 367 QUIC_VERSION_29 = 29, // Server and client honor QUIC_STREAM_NO_ERROR. |
368 QUIC_VERSION_30 = 30, // Add server side support of cert transparency. | 368 QUIC_VERSION_30 = 30, // Add server side support of cert transparency. |
369 QUIC_VERSION_31 = 31, // Adds a hash of the client hello to crypto proof. | 369 QUIC_VERSION_31 = 31, // Adds a hash of the client hello to crypto proof. |
370 QUIC_VERSION_32 = 32, // FEC related fields are removed from wire format. | 370 QUIC_VERSION_32 = 32, // FEC related fields are removed from wire format. |
371 QUIC_VERSION_33 = 33, // Adds diversification nonces. | 371 QUIC_VERSION_33 = 33, // Adds diversification nonces. |
372 QUIC_VERSION_34 = 34, // Deprecates entropy, removes private flag from packet | 372 QUIC_VERSION_34 = 34, // Deprecates entropy, removes private flag from packet |
373 // header, uses new ack and stop waiting wire format. | 373 // header, uses new ack and stop waiting wire format. |
| 374 QUIC_VERSION_35 = 35, // Allows endpoints to independently set stream limit. |
374 }; | 375 }; |
375 | 376 |
376 // This vector contains QUIC versions which we currently support. | 377 // This vector contains QUIC versions which we currently support. |
377 // This should be ordered such that the highest supported version is the first | 378 // This should be ordered such that the highest supported version is the first |
378 // element, with subsequent elements in descending order (versions can be | 379 // element, with subsequent elements in descending order (versions can be |
379 // skipped as necessary). | 380 // skipped as necessary). |
380 // | 381 // |
381 // IMPORTANT: if you are adding to this list, follow the instructions at | 382 // IMPORTANT: if you are adding to this list, follow the instructions at |
382 // http://sites/quic/adding-and-removing-versions | 383 // http://sites/quic/adding-and-removing-versions |
383 static const QuicVersion kSupportedQuicVersions[] = { | 384 static const QuicVersion kSupportedQuicVersions[] = { |
384 QUIC_VERSION_34, QUIC_VERSION_33, QUIC_VERSION_32, QUIC_VERSION_31, | 385 QUIC_VERSION_35, QUIC_VERSION_34, QUIC_VERSION_33, QUIC_VERSION_32, |
385 QUIC_VERSION_30, QUIC_VERSION_29, QUIC_VERSION_28, QUIC_VERSION_27, | 386 QUIC_VERSION_31, QUIC_VERSION_30, QUIC_VERSION_29, QUIC_VERSION_28, |
386 QUIC_VERSION_26, QUIC_VERSION_25}; | 387 QUIC_VERSION_27, QUIC_VERSION_26, QUIC_VERSION_25}; |
387 | 388 |
388 typedef std::vector<QuicVersion> QuicVersionVector; | 389 typedef std::vector<QuicVersion> QuicVersionVector; |
389 | 390 |
390 // Returns a vector of QUIC versions in kSupportedQuicVersions. | 391 // Returns a vector of QUIC versions in kSupportedQuicVersions. |
391 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); | 392 NET_EXPORT_PRIVATE QuicVersionVector QuicSupportedVersions(); |
392 | 393 |
393 // Returns a vector of QUIC versions from |versions| which exclude any versions | 394 // Returns a vector of QUIC versions from |versions| which exclude any versions |
394 // which are disabled by flags. | 395 // which are disabled by flags. |
395 NET_EXPORT_PRIVATE QuicVersionVector | 396 NET_EXPORT_PRIVATE QuicVersionVector |
396 FilterSupportedVersions(QuicVersionVector versions); | 397 FilterSupportedVersions(QuicVersionVector versions); |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 // |retransmitted_bytes| is the number of data bytes retransmitted. | 1351 // |retransmitted_bytes| is the number of data bytes retransmitted. |
1351 virtual void OnPacketRetransmitted(int retransmitted_bytes) = 0; | 1352 virtual void OnPacketRetransmitted(int retransmitted_bytes) = 0; |
1352 | 1353 |
1353 protected: | 1354 protected: |
1354 friend class base::RefCounted<QuicAckListenerInterface>; | 1355 friend class base::RefCounted<QuicAckListenerInterface>; |
1355 | 1356 |
1356 // Delegates are ref counted. | 1357 // Delegates are ref counted. |
1357 virtual ~QuicAckListenerInterface() {} | 1358 virtual ~QuicAckListenerInterface() {} |
1358 }; | 1359 }; |
1359 | 1360 |
| 1361 // Pure virtual class to close connection on unrecoverable errors. |
| 1362 class NET_EXPORT_PRIVATE QuicConnectionCloseDelegateInterface { |
| 1363 public: |
| 1364 virtual ~QuicConnectionCloseDelegateInterface() {} |
| 1365 |
| 1366 // Called when an unrecoverable error is encountered. |
| 1367 virtual void OnUnrecoverableError(QuicErrorCode error, |
| 1368 const std::string& error_details, |
| 1369 ConnectionCloseSource source) = 0; |
| 1370 }; |
| 1371 |
1360 struct NET_EXPORT_PRIVATE AckListenerWrapper { | 1372 struct NET_EXPORT_PRIVATE AckListenerWrapper { |
1361 AckListenerWrapper(QuicAckListenerInterface* listener, | 1373 AckListenerWrapper(QuicAckListenerInterface* listener, |
1362 QuicPacketLength data_length); | 1374 QuicPacketLength data_length); |
1363 AckListenerWrapper(const AckListenerWrapper& other); | 1375 AckListenerWrapper(const AckListenerWrapper& other); |
1364 ~AckListenerWrapper(); | 1376 ~AckListenerWrapper(); |
1365 | 1377 |
1366 scoped_refptr<QuicAckListenerInterface> ack_listener; | 1378 scoped_refptr<QuicAckListenerInterface> ack_listener; |
1367 QuicPacketLength length; | 1379 QuicPacketLength length; |
1368 }; | 1380 }; |
1369 | 1381 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 : iov(iov), iov_count(iov_count), total_length(total_length) {} | 1493 : iov(iov), iov_count(iov_count), total_length(total_length) {} |
1482 | 1494 |
1483 const struct iovec* iov; | 1495 const struct iovec* iov; |
1484 const int iov_count; | 1496 const int iov_count; |
1485 const size_t total_length; | 1497 const size_t total_length; |
1486 }; | 1498 }; |
1487 | 1499 |
1488 } // namespace net | 1500 } // namespace net |
1489 | 1501 |
1490 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1502 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |