| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 486 | 486 | 
| 487 // Because receiving an unknown QuicRstStreamErrorCode results in connection | 487 // Because receiving an unknown QuicRstStreamErrorCode results in connection | 
| 488 // teardown, we use this to make sure any errors predating a given version are | 488 // teardown, we use this to make sure any errors predating a given version are | 
| 489 // downgraded to the most appropriate existing error. | 489 // downgraded to the most appropriate existing error. | 
| 490 NET_EXPORT_PRIVATE QuicRstStreamErrorCode | 490 NET_EXPORT_PRIVATE QuicRstStreamErrorCode | 
| 491 AdjustErrorForVersion(QuicRstStreamErrorCode error_code, QuicVersion version); | 491 AdjustErrorForVersion(QuicRstStreamErrorCode error_code, QuicVersion version); | 
| 492 | 492 | 
| 493 // These values must remain stable as they are uploaded to UMA histograms. | 493 // These values must remain stable as they are uploaded to UMA histograms. | 
| 494 // To add a new error code, use the current value of QUIC_LAST_ERROR and | 494 // To add a new error code, use the current value of QUIC_LAST_ERROR and | 
| 495 // increment QUIC_LAST_ERROR. | 495 // increment QUIC_LAST_ERROR. | 
| 496 // last value = 80 |  | 
| 497 enum QuicErrorCode { | 496 enum QuicErrorCode { | 
| 498   QUIC_NO_ERROR = 0, | 497   QUIC_NO_ERROR = 0, | 
| 499 | 498 | 
| 500   // Connection has reached an invalid state. | 499   // Connection has reached an invalid state. | 
| 501   QUIC_INTERNAL_ERROR = 1, | 500   QUIC_INTERNAL_ERROR = 1, | 
| 502   // There were data frames after the a fin or reset. | 501   // There were data frames after the a fin or reset. | 
| 503   QUIC_STREAM_DATA_AFTER_TERMINATION = 2, | 502   QUIC_STREAM_DATA_AFTER_TERMINATION = 2, | 
| 504   // Control frame is malformed. | 503   // Control frame is malformed. | 
| 505   QUIC_INVALID_PACKET_HEADER = 3, | 504   QUIC_INVALID_PACKET_HEADER = 3, | 
| 506   // Frame data is malformed. | 505   // Frame data is malformed. | 
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 556   QUIC_PUBLIC_RESET = 19, | 555   QUIC_PUBLIC_RESET = 19, | 
| 557   // Invalid protocol version. | 556   // Invalid protocol version. | 
| 558   QUIC_INVALID_VERSION = 20, | 557   QUIC_INVALID_VERSION = 20, | 
| 559 | 558 | 
| 560   // The Header ID for a stream was too far from the previous. | 559   // The Header ID for a stream was too far from the previous. | 
| 561   QUIC_INVALID_HEADER_ID = 22, | 560   QUIC_INVALID_HEADER_ID = 22, | 
| 562   // Negotiable parameter received during handshake had invalid value. | 561   // Negotiable parameter received during handshake had invalid value. | 
| 563   QUIC_INVALID_NEGOTIATED_VALUE = 23, | 562   QUIC_INVALID_NEGOTIATED_VALUE = 23, | 
| 564   // There was an error decompressing data. | 563   // There was an error decompressing data. | 
| 565   QUIC_DECOMPRESSION_FAILURE = 24, | 564   QUIC_DECOMPRESSION_FAILURE = 24, | 
| 566   // We hit our prenegotiated (or default) timeout | 565   // The connection timed out due to no network activity. | 
| 567   QUIC_CONNECTION_TIMED_OUT = 25, | 566   QUIC_NETWORK_IDLE_TIMEOUT = 25, | 
| 568   // We hit our overall connection timeout | 567   // The connection timed out waiting for the handshake to complete. | 
| 569   QUIC_CONNECTION_OVERALL_TIMED_OUT = 67, | 568   QUIC_HANDSHAKE_TIMEOUT = 67, | 
| 570   // There was an error encountered migrating addresses | 569   // There was an error encountered migrating addresses | 
| 571   QUIC_ERROR_MIGRATING_ADDRESS = 26, | 570   QUIC_ERROR_MIGRATING_ADDRESS = 26, | 
| 572   // There was an error while writing to the socket. | 571   // There was an error while writing to the socket. | 
| 573   QUIC_PACKET_WRITE_ERROR = 27, | 572   QUIC_PACKET_WRITE_ERROR = 27, | 
| 574   // There was an error while reading from the socket. | 573   // There was an error while reading from the socket. | 
| 575   QUIC_PACKET_READ_ERROR = 51, | 574   QUIC_PACKET_READ_ERROR = 51, | 
| 576   // We received a STREAM_FRAME with no data and no fin flag set. | 575   // We received a STREAM_FRAME with no data and no fin flag set. | 
| 577   QUIC_INVALID_STREAM_FRAME = 50, | 576   QUIC_INVALID_STREAM_FRAME = 50, | 
| 578   // We received invalid data on the headers stream. | 577   // We received invalid data on the headers stream. | 
| 579   QUIC_INVALID_HEADERS_STREAM_DATA = 56, | 578   QUIC_INVALID_HEADERS_STREAM_DATA = 56, | 
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1287   ~AckListenerWrapper(); | 1286   ~AckListenerWrapper(); | 
| 1288 | 1287 | 
| 1289   scoped_refptr<QuicAckListenerInterface> ack_listener; | 1288   scoped_refptr<QuicAckListenerInterface> ack_listener; | 
| 1290   QuicPacketLength length; | 1289   QuicPacketLength length; | 
| 1291 }; | 1290 }; | 
| 1292 | 1291 | 
| 1293 struct NET_EXPORT_PRIVATE SerializedPacket { | 1292 struct NET_EXPORT_PRIVATE SerializedPacket { | 
| 1294   SerializedPacket(QuicPathId path_id, | 1293   SerializedPacket(QuicPathId path_id, | 
| 1295                    QuicPacketNumber packet_number, | 1294                    QuicPacketNumber packet_number, | 
| 1296                    QuicPacketNumberLength packet_number_length, | 1295                    QuicPacketNumberLength packet_number_length, | 
| 1297                    QuicEncryptedPacket* packet, | 1296                    const char* encrypted_buffer, | 
|  | 1297                    QuicPacketLength encrypted_length, | 
| 1298                    QuicPacketEntropyHash entropy_hash, | 1298                    QuicPacketEntropyHash entropy_hash, | 
| 1299                    bool has_ack, | 1299                    bool has_ack, | 
| 1300                    bool has_stop_waiting); | 1300                    bool has_stop_waiting); | 
| 1301   ~SerializedPacket(); | 1301   ~SerializedPacket(); | 
| 1302 | 1302 | 
| 1303   QuicEncryptedPacket* packet; | 1303   // Not owned. | 
|  | 1304   const char* encrypted_buffer; | 
|  | 1305   QuicPacketLength encrypted_length; | 
| 1304   QuicFrames retransmittable_frames; | 1306   QuicFrames retransmittable_frames; | 
| 1305   IsHandshake has_crypto_handshake; | 1307   IsHandshake has_crypto_handshake; | 
| 1306   bool needs_padding; | 1308   bool needs_padding; | 
| 1307   QuicPathId path_id; | 1309   QuicPathId path_id; | 
| 1308   QuicPacketNumber packet_number; | 1310   QuicPacketNumber packet_number; | 
| 1309   QuicPacketNumberLength packet_number_length; | 1311   QuicPacketNumberLength packet_number_length; | 
| 1310   EncryptionLevel encryption_level; | 1312   EncryptionLevel encryption_level; | 
| 1311   QuicPacketEntropyHash entropy_hash; | 1313   QuicPacketEntropyHash entropy_hash; | 
| 1312   bool is_fec_packet; | 1314   bool is_fec_packet; | 
| 1313   bool has_ack; | 1315   bool has_ack; | 
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1399       : iov(iov), iov_count(iov_count), total_length(total_length) {} | 1401       : iov(iov), iov_count(iov_count), total_length(total_length) {} | 
| 1400 | 1402 | 
| 1401   const struct iovec* iov; | 1403   const struct iovec* iov; | 
| 1402   const int iov_count; | 1404   const int iov_count; | 
| 1403   const size_t total_length; | 1405   const size_t total_length; | 
| 1404 }; | 1406 }; | 
| 1405 | 1407 | 
| 1406 }  // namespace net | 1408 }  // namespace net | 
| 1407 | 1409 | 
| 1408 #endif  // NET_QUIC_QUIC_PROTOCOL_H_ | 1410 #endif  // NET_QUIC_QUIC_PROTOCOL_H_ | 
| OLD | NEW | 
|---|