Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Side by Side Diff: net/quic/quic_protocol.h

Issue 14718011: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_packet_generator_test.cc ('k') | net/quic/quic_protocol.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 QUIC_CRYPTO_INTERNAL_ERROR, 217 QUIC_CRYPTO_INTERNAL_ERROR,
218 // A crypto handshake message specified an unsupported version. 218 // A crypto handshake message specified an unsupported version.
219 QUIC_CRYPTO_VERSION_NOT_SUPPORTED, 219 QUIC_CRYPTO_VERSION_NOT_SUPPORTED,
220 // There was no intersection between the crypto primitives supported by the 220 // There was no intersection between the crypto primitives supported by the
221 // peer and ourselves. 221 // peer and ourselves.
222 QUIC_CRYPTO_NO_SUPPORT, 222 QUIC_CRYPTO_NO_SUPPORT,
223 // The server rejected our client hello messages too many times. 223 // The server rejected our client hello messages too many times.
224 QUIC_CRYPTO_TOO_MANY_REJECTS, 224 QUIC_CRYPTO_TOO_MANY_REJECTS,
225 // The client rejected the server's certificate chain or signature. 225 // The client rejected the server's certificate chain or signature.
226 QUIC_PROOF_INVALID, 226 QUIC_PROOF_INVALID,
227 // A crypto message was received with a duplicate tag.
228 QUIC_CRYPTO_DUPLICATE_TAG,
227 229
228 // No error. Used as bound while iterating. 230 // No error. Used as bound while iterating.
229 QUIC_LAST_ERROR, 231 QUIC_LAST_ERROR,
230 }; 232 };
231 233
232 // Version and Crypto tags are written to the wire with a big-endian 234 // Version and Crypto tags are written to the wire with a big-endian
233 // representation of the name of the tag. For example 235 // representation of the name of the tag. For example
234 // the client hello tag (CHLO) will be written as the 236 // the client hello tag (CHLO) will be written as the
235 // following 4 bytes: 'C' 'H' 'L' 'O'. Since it is 237 // following 4 bytes: 'C' 'H' 'L' 'O'. Since it is
236 // stored in memory as a little endian uint32, we need 238 // stored in memory as a little endian uint32, we need
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 QuicGoAwayFrame() {} 456 QuicGoAwayFrame() {}
455 QuicGoAwayFrame(QuicErrorCode error_code, 457 QuicGoAwayFrame(QuicErrorCode error_code,
456 QuicStreamId last_good_stream_id, 458 QuicStreamId last_good_stream_id,
457 const std::string& reason); 459 const std::string& reason);
458 460
459 QuicErrorCode error_code; 461 QuicErrorCode error_code;
460 QuicStreamId last_good_stream_id; 462 QuicStreamId last_good_stream_id;
461 std::string reason_phrase; 463 std::string reason_phrase;
462 }; 464 };
463 465
466 // EncryptionLevel enumerates the stages of encryption that a QUIC connection
467 // progresses through. When retransmitting a packet, the encryption level needs
468 // to be specified so that it is retransmitted at a level which the peer can
469 // understand.
470 enum EncryptionLevel {
471 ENCRYPTION_NONE = 0,
472 ENCRYPTION_INITIAL = 1,
473 ENCRYPTION_FORWARD_SECURE = 2,
474
475 NUM_ENCRYPTION_LEVELS,
476 };
477
464 struct NET_EXPORT_PRIVATE QuicFrame { 478 struct NET_EXPORT_PRIVATE QuicFrame {
465 QuicFrame() {} 479 QuicFrame() {}
466 explicit QuicFrame(QuicPaddingFrame* padding_frame) 480 explicit QuicFrame(QuicPaddingFrame* padding_frame)
467 : type(PADDING_FRAME), 481 : type(PADDING_FRAME),
468 padding_frame(padding_frame) { 482 padding_frame(padding_frame) {
469 } 483 }
470 explicit QuicFrame(QuicStreamFrame* stream_frame) 484 explicit QuicFrame(QuicStreamFrame* stream_frame)
471 : type(STREAM_FRAME), 485 : type(STREAM_FRAME),
472 stream_frame(stream_frame) { 486 stream_frame(stream_frame) {
473 } 487 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 ~RetransmittableFrames(); 635 ~RetransmittableFrames();
622 636
623 // Allocates a local copy of the referenced StringPiece has QuicStreamFrame 637 // Allocates a local copy of the referenced StringPiece has QuicStreamFrame
624 // use it. 638 // use it.
625 // Takes ownership of |stream_frame|. 639 // Takes ownership of |stream_frame|.
626 const QuicFrame& AddStreamFrame(QuicStreamFrame* stream_frame); 640 const QuicFrame& AddStreamFrame(QuicStreamFrame* stream_frame);
627 // Takes ownership of the frame inside |frame|. 641 // Takes ownership of the frame inside |frame|.
628 const QuicFrame& AddNonStreamFrame(const QuicFrame& frame); 642 const QuicFrame& AddNonStreamFrame(const QuicFrame& frame);
629 const QuicFrames& frames() const { return frames_; } 643 const QuicFrames& frames() const { return frames_; }
630 644
645 void set_encryption_level(EncryptionLevel level);
646 EncryptionLevel encryption_level() const {
647 return encryption_level_;
648 }
649
631 private: 650 private:
632 QuicFrames frames_; 651 QuicFrames frames_;
652 EncryptionLevel encryption_level_;
633 // Data referenced by the StringPiece of a QuicStreamFrame. 653 // Data referenced by the StringPiece of a QuicStreamFrame.
634 std::vector<std::string*> stream_data_; 654 std::vector<std::string*> stream_data_;
635 655
636 DISALLOW_COPY_AND_ASSIGN(RetransmittableFrames); 656 DISALLOW_COPY_AND_ASSIGN(RetransmittableFrames);
637 }; 657 };
638 658
639 struct NET_EXPORT_PRIVATE SerializedPacket { 659 struct NET_EXPORT_PRIVATE SerializedPacket {
640 SerializedPacket(QuicPacketSequenceNumber sequence_number, 660 SerializedPacket(QuicPacketSequenceNumber sequence_number,
641 QuicPacket* packet, 661 QuicPacket* packet,
642 QuicPacketEntropyHash entropy_hash, 662 QuicPacketEntropyHash entropy_hash,
(...skipping 24 matching lines...) Expand all
667 NET_EXPORT_PRIVATE friend std::ostream& operator<<( 687 NET_EXPORT_PRIVATE friend std::ostream& operator<<(
668 std::ostream& os, const QuicConsumedData& s); 688 std::ostream& os, const QuicConsumedData& s);
669 689
670 size_t bytes_consumed; 690 size_t bytes_consumed;
671 bool fin_consumed; 691 bool fin_consumed;
672 }; 692 };
673 693
674 } // namespace net 694 } // namespace net
675 695
676 #endif // NET_QUIC_QUIC_PROTOCOL_H_ 696 #endif // NET_QUIC_QUIC_PROTOCOL_H_
OLDNEW
« no previous file with comments | « net/quic/quic_packet_generator_test.cc ('k') | net/quic/quic_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698