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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 467 |
468 // Because receiving an unknown QuicRstStreamErrorCode results in connection | 468 // Because receiving an unknown QuicRstStreamErrorCode results in connection |
469 // teardown, we use this to make sure any errors predating a given version are | 469 // teardown, we use this to make sure any errors predating a given version are |
470 // downgraded to the most appropriate existing error. | 470 // downgraded to the most appropriate existing error. |
471 NET_EXPORT_PRIVATE QuicRstStreamErrorCode | 471 NET_EXPORT_PRIVATE QuicRstStreamErrorCode |
472 AdjustErrorForVersion(QuicRstStreamErrorCode error_code, QuicVersion version); | 472 AdjustErrorForVersion(QuicRstStreamErrorCode error_code, QuicVersion version); |
473 | 473 |
474 // These values must remain stable as they are uploaded to UMA histograms. | 474 // These values must remain stable as they are uploaded to UMA histograms. |
475 // To add a new error code, use the current value of QUIC_LAST_ERROR and | 475 // To add a new error code, use the current value of QUIC_LAST_ERROR and |
476 // increment QUIC_LAST_ERROR. | 476 // increment QUIC_LAST_ERROR. |
477 // last value = 77 | 477 // last value = 78 |
478 enum QuicErrorCode { | 478 enum QuicErrorCode { |
479 QUIC_NO_ERROR = 0, | 479 QUIC_NO_ERROR = 0, |
480 | 480 |
481 // Connection has reached an invalid state. | 481 // Connection has reached an invalid state. |
482 QUIC_INTERNAL_ERROR = 1, | 482 QUIC_INTERNAL_ERROR = 1, |
483 // There were data frames after the a fin or reset. | 483 // There were data frames after the a fin or reset. |
484 QUIC_STREAM_DATA_AFTER_TERMINATION = 2, | 484 QUIC_STREAM_DATA_AFTER_TERMINATION = 2, |
485 // Control frame is malformed. | 485 // Control frame is malformed. |
486 QUIC_INVALID_PACKET_HEADER = 3, | 486 QUIC_INVALID_PACKET_HEADER = 3, |
487 // Frame data is malformed. | 487 // Frame data is malformed. |
488 QUIC_INVALID_FRAME_DATA = 4, | 488 QUIC_INVALID_FRAME_DATA = 4, |
489 // The packet contained no payload. | 489 // The packet contained no payload. |
490 QUIC_MISSING_PAYLOAD = 48, | 490 QUIC_MISSING_PAYLOAD = 48, |
491 // FEC data is malformed. | 491 // FEC data is malformed. |
492 QUIC_INVALID_FEC_DATA = 5, | 492 QUIC_INVALID_FEC_DATA = 5, |
493 // STREAM frame data is malformed. | 493 // STREAM frame data is malformed. |
494 QUIC_INVALID_STREAM_DATA = 46, | 494 QUIC_INVALID_STREAM_DATA = 46, |
495 // STREAM frame data is not encrypted. | 495 // STREAM frame data is not encrypted. |
496 QUIC_UNENCRYPTED_STREAM_DATA = 61, | 496 QUIC_UNENCRYPTED_STREAM_DATA = 61, |
| 497 // FEC frame data is not encrypted. |
| 498 QUIC_UNENCRYPTED_FEC_DATA = 77, |
497 // RST_STREAM frame data is malformed. | 499 // RST_STREAM frame data is malformed. |
498 QUIC_INVALID_RST_STREAM_DATA = 6, | 500 QUIC_INVALID_RST_STREAM_DATA = 6, |
499 // CONNECTION_CLOSE frame data is malformed. | 501 // CONNECTION_CLOSE frame data is malformed. |
500 QUIC_INVALID_CONNECTION_CLOSE_DATA = 7, | 502 QUIC_INVALID_CONNECTION_CLOSE_DATA = 7, |
501 // GOAWAY frame data is malformed. | 503 // GOAWAY frame data is malformed. |
502 QUIC_INVALID_GOAWAY_DATA = 8, | 504 QUIC_INVALID_GOAWAY_DATA = 8, |
503 // WINDOW_UPDATE frame data is malformed. | 505 // WINDOW_UPDATE frame data is malformed. |
504 QUIC_INVALID_WINDOW_UPDATE_DATA = 57, | 506 QUIC_INVALID_WINDOW_UPDATE_DATA = 57, |
505 // BLOCKED frame data is malformed. | 507 // BLOCKED frame data is malformed. |
506 QUIC_INVALID_BLOCKED_DATA = 58, | 508 QUIC_INVALID_BLOCKED_DATA = 58, |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 // A handshake message arrived, but we are still validating the | 630 // A handshake message arrived, but we are still validating the |
629 // previous handshake message. | 631 // previous handshake message. |
630 QUIC_CRYPTO_MESSAGE_WHILE_VALIDATING_CLIENT_HELLO = 54, | 632 QUIC_CRYPTO_MESSAGE_WHILE_VALIDATING_CLIENT_HELLO = 54, |
631 // A server config update arrived before the handshake is complete. | 633 // A server config update arrived before the handshake is complete. |
632 QUIC_CRYPTO_UPDATE_BEFORE_HANDSHAKE_COMPLETE = 65, | 634 QUIC_CRYPTO_UPDATE_BEFORE_HANDSHAKE_COMPLETE = 65, |
633 // This connection involved a version negotiation which appears to have been | 635 // This connection involved a version negotiation which appears to have been |
634 // tampered with. | 636 // tampered with. |
635 QUIC_VERSION_NEGOTIATION_MISMATCH = 55, | 637 QUIC_VERSION_NEGOTIATION_MISMATCH = 55, |
636 | 638 |
637 // No error. Used as bound while iterating. | 639 // No error. Used as bound while iterating. |
638 QUIC_LAST_ERROR = 77, | 640 QUIC_LAST_ERROR = 78, |
639 }; | 641 }; |
640 | 642 |
641 // Must be updated any time a QuicErrorCode is deprecated. | 643 // Must be updated any time a QuicErrorCode is deprecated. |
642 const int kDeprecatedQuicErrorCount = 4; | 644 const int kDeprecatedQuicErrorCount = 4; |
643 const int kActiveQuicErrorCount = QUIC_LAST_ERROR - kDeprecatedQuicErrorCount; | 645 const int kActiveQuicErrorCount = QUIC_LAST_ERROR - kDeprecatedQuicErrorCount; |
644 | 646 |
645 struct NET_EXPORT_PRIVATE QuicPacketPublicHeader { | 647 struct NET_EXPORT_PRIVATE QuicPacketPublicHeader { |
646 QuicPacketPublicHeader(); | 648 QuicPacketPublicHeader(); |
647 explicit QuicPacketPublicHeader(const QuicPacketPublicHeader& other); | 649 explicit QuicPacketPublicHeader(const QuicPacketPublicHeader& other); |
648 ~QuicPacketPublicHeader(); | 650 ~QuicPacketPublicHeader(); |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 : iov(iov), iov_count(iov_count), total_length(total_length) {} | 1312 : iov(iov), iov_count(iov_count), total_length(total_length) {} |
1311 | 1313 |
1312 const struct iovec* iov; | 1314 const struct iovec* iov; |
1313 const int iov_count; | 1315 const int iov_count; |
1314 const size_t total_length; | 1316 const size_t total_length; |
1315 }; | 1317 }; |
1316 | 1318 |
1317 } // namespace net | 1319 } // namespace net |
1318 | 1320 |
1319 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1321 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |