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 // The entity that handles framing writes for a Quic client or server. | 5 // The entity that handles framing writes for a Quic client or server. |
6 // Each QuicSession will have a connection associated with it. | 6 // Each QuicSession will have a connection associated with it. |
7 // | 7 // |
8 // On the server side, the Dispatcher handles the raw reads, and hands off | 8 // On the server side, the Dispatcher handles the raw reads, and hands off |
9 // packets via ProcessUdpPacket for framing and processing. | 9 // packets via ProcessUdpPacket for framing and processing. |
10 // | 10 // |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 void OnRetransmissionTimeout(); | 453 void OnRetransmissionTimeout(); |
454 | 454 |
455 // Retransmits all unacked packets with retransmittable frames if | 455 // Retransmits all unacked packets with retransmittable frames if |
456 // |retransmission_type| is ALL_UNACKED_PACKETS, otherwise retransmits only | 456 // |retransmission_type| is ALL_UNACKED_PACKETS, otherwise retransmits only |
457 // initially encrypted packets. Used when the negotiated protocol version is | 457 // initially encrypted packets. Used when the negotiated protocol version is |
458 // different from what was initially assumed and when the initial encryption | 458 // different from what was initially assumed and when the initial encryption |
459 // changes. | 459 // changes. |
460 void RetransmitUnackedPackets(TransmissionType retransmission_type); | 460 void RetransmitUnackedPackets(TransmissionType retransmission_type); |
461 | 461 |
462 // Calls |sent_packet_manager_|'s NeuterUnencryptedPackets. Used when the | 462 // Calls |sent_packet_manager_|'s NeuterUnencryptedPackets. Used when the |
463 // connection becomes forward secure and hasn't received acks for all packets. | 463 // connection becomes forward-secure and hasn't received acks for all packets. |
464 void NeuterUnencryptedPackets(); | 464 void NeuterUnencryptedPackets(); |
465 | 465 |
466 // Changes the encrypter used for level |level| to |encrypter|. The function | 466 // Changes the encrypter used for level |level| to |encrypter|. The function |
467 // takes ownership of |encrypter|. | 467 // takes ownership of |encrypter|. |
468 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter); | 468 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter); |
469 const QuicEncrypter* encrypter(EncryptionLevel level) const; | 469 const QuicEncrypter* encrypter(EncryptionLevel level) const; |
470 | 470 |
471 // SetDefaultEncryptionLevel sets the encryption level that will be applied | 471 // SetDefaultEncryptionLevel sets the encryption level that will be applied |
472 // to new packets. | 472 // to new packets. |
473 void SetDefaultEncryptionLevel(EncryptionLevel level); | 473 void SetDefaultEncryptionLevel(EncryptionLevel level); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 void CheckForAddressMigration(const IPEndPoint& self_address, | 671 void CheckForAddressMigration(const IPEndPoint& self_address, |
672 const IPEndPoint& peer_address); | 672 const IPEndPoint& peer_address); |
673 | 673 |
674 HasRetransmittableData IsRetransmittable(const QueuedPacket& packet); | 674 HasRetransmittableData IsRetransmittable(const QueuedPacket& packet); |
675 bool IsConnectionClose(QueuedPacket packet); | 675 bool IsConnectionClose(QueuedPacket packet); |
676 | 676 |
677 QuicFramer framer_; | 677 QuicFramer framer_; |
678 QuicConnectionHelperInterface* helper_; // Not owned. | 678 QuicConnectionHelperInterface* helper_; // Not owned. |
679 QuicPacketWriter* writer_; // Owned or not depending on |owns_writer_|. | 679 QuicPacketWriter* writer_; // Owned or not depending on |owns_writer_|. |
680 bool owns_writer_; | 680 bool owns_writer_; |
| 681 // Encryption level for new packets. Should only be changed via |
| 682 // SetDefaultEncryptionLevel(). |
681 EncryptionLevel encryption_level_; | 683 EncryptionLevel encryption_level_; |
| 684 bool has_forward_secure_encrypter_; |
| 685 // The sequence number of the first packet which will be encrypted with the |
| 686 // foward-secure encrypter, even if the peer has not started sending |
| 687 // forward-secure packets. |
| 688 QuicPacketSequenceNumber first_required_forward_secure_packet_; |
682 const QuicClock* clock_; | 689 const QuicClock* clock_; |
683 QuicRandom* random_generator_; | 690 QuicRandom* random_generator_; |
684 | 691 |
685 const QuicConnectionId connection_id_; | 692 const QuicConnectionId connection_id_; |
686 // Address on the last successfully processed packet received from the | 693 // Address on the last successfully processed packet received from the |
687 // client. | 694 // client. |
688 IPEndPoint self_address_; | 695 IPEndPoint self_address_; |
689 IPEndPoint peer_address_; | 696 IPEndPoint peer_address_; |
690 // Used to store latest peer port to possibly migrate to later. | 697 // Used to store latest peer port to possibly migrate to later. |
691 int migrating_peer_port_; | 698 int migrating_peer_port_; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 // If non-empty this contains the set of versions received in a | 835 // If non-empty this contains the set of versions received in a |
829 // version negotiation packet. | 836 // version negotiation packet. |
830 QuicVersionVector server_supported_versions_; | 837 QuicVersionVector server_supported_versions_; |
831 | 838 |
832 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 839 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
833 }; | 840 }; |
834 | 841 |
835 } // namespace net | 842 } // namespace net |
836 | 843 |
837 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 844 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |