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
3 // found in the LICENSE file.
5 #include "net/quic/quic_protocol.h"
7 #include "base/stl_util.h"
8 #include "net/quic/quic_utils.h"
10 using base::StringPiece
;
12 using std::numeric_limits
;
18 size_t GetPacketHeaderSize(const QuicPacketHeader
& header
) {
19 return GetPacketHeaderSize(header
.public_header
.connection_id_length
,
20 header
.public_header
.version_flag
,
21 header
.public_header
.sequence_number_length
,
22 header
.is_in_fec_group
);
25 size_t GetPacketHeaderSize(QuicConnectionIdLength connection_id_length
,
27 QuicSequenceNumberLength sequence_number_length
,
28 InFecGroup is_in_fec_group
) {
29 return kPublicFlagsSize
+ connection_id_length
+
30 (include_version
? kQuicVersionSize
: 0) + sequence_number_length
+
31 kPrivateFlagsSize
+ (is_in_fec_group
== IN_FEC_GROUP
? kFecGroupSize
: 0);
34 size_t GetStartOfFecProtectedData(
35 QuicConnectionIdLength connection_id_length
,
37 QuicSequenceNumberLength sequence_number_length
) {
38 return GetPacketHeaderSize(connection_id_length
,
40 sequence_number_length
,
44 size_t GetStartOfEncryptedData(
45 QuicConnectionIdLength connection_id_length
,
47 QuicSequenceNumberLength sequence_number_length
) {
48 // Don't include the fec size, since encryption starts before private flags.
49 return GetPacketHeaderSize(connection_id_length
,
51 sequence_number_length
,
52 NOT_IN_FEC_GROUP
) - kPrivateFlagsSize
;
55 QuicPacketPublicHeader::QuicPacketPublicHeader()
57 connection_id_length(PACKET_8BYTE_CONNECTION_ID
),
60 sequence_number_length(PACKET_6BYTE_SEQUENCE_NUMBER
) {
63 QuicPacketPublicHeader::QuicPacketPublicHeader(
64 const QuicPacketPublicHeader
& other
)
65 : connection_id(other
.connection_id
),
66 connection_id_length(other
.connection_id_length
),
67 reset_flag(other
.reset_flag
),
68 version_flag(other
.version_flag
),
69 sequence_number_length(other
.sequence_number_length
),
70 versions(other
.versions
) {
73 QuicPacketPublicHeader::~QuicPacketPublicHeader() {}
75 QuicPacketHeader::QuicPacketHeader()
79 packet_sequence_number(0),
80 is_in_fec_group(NOT_IN_FEC_GROUP
),
84 QuicPacketHeader::QuicPacketHeader(const QuicPacketPublicHeader
& header
)
85 : public_header(header
),
89 packet_sequence_number(0),
90 is_in_fec_group(NOT_IN_FEC_GROUP
),
94 QuicPublicResetPacket::QuicPublicResetPacket()
96 rejected_sequence_number(0) {}
98 QuicPublicResetPacket::QuicPublicResetPacket(
99 const QuicPacketPublicHeader
& header
)
100 : public_header(header
),
102 rejected_sequence_number(0) {}
104 QuicStreamFrame::QuicStreamFrame()
110 QuicStreamFrame::QuicStreamFrame(const QuicStreamFrame
& frame
)
111 : stream_id(frame
.stream_id
),
113 offset(frame
.offset
),
115 notifier(frame
.notifier
) {
118 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id
,
120 QuicStreamOffset offset
,
122 : stream_id(stream_id
),
129 string
* QuicStreamFrame::GetDataAsString() const {
130 string
* data_string
= new string();
131 data_string
->reserve(data
.TotalBufferSize());
132 for (size_t i
= 0; i
< data
.Size(); ++i
) {
133 data_string
->append(static_cast<char*>(data
.iovec()[i
].iov_base
),
134 data
.iovec()[i
].iov_len
);
136 DCHECK_EQ(data_string
->size(), data
.TotalBufferSize());
140 uint32
MakeQuicTag(char a
, char b
, char c
, char d
) {
141 return static_cast<uint32
>(a
) |
142 static_cast<uint32
>(b
) << 8 |
143 static_cast<uint32
>(c
) << 16 |
144 static_cast<uint32
>(d
) << 24;
147 bool ContainsQuicTag(const QuicTagVector
& tag_vector
, QuicTag tag
) {
148 return std::find(tag_vector
.begin(), tag_vector
.end(), tag
)
152 QuicVersionVector
QuicSupportedVersions() {
153 QuicVersionVector supported_versions
;
154 for (size_t i
= 0; i
< arraysize(kSupportedQuicVersions
); ++i
) {
155 supported_versions
.push_back(kSupportedQuicVersions
[i
]);
157 return supported_versions
;
160 QuicTag
QuicVersionToQuicTag(const QuicVersion version
) {
162 case QUIC_VERSION_16
:
163 return MakeQuicTag('Q', '0', '1', '6');
164 case QUIC_VERSION_18
:
165 return MakeQuicTag('Q', '0', '1', '8');
166 case QUIC_VERSION_19
:
167 return MakeQuicTag('Q', '0', '1', '9');
168 case QUIC_VERSION_20
:
169 return MakeQuicTag('Q', '0', '2', '0');
170 case QUIC_VERSION_21
:
171 return MakeQuicTag('Q', '0', '2', '1');
172 case QUIC_VERSION_22
:
173 return MakeQuicTag('Q', '0', '2', '2');
174 case QUIC_VERSION_23
:
175 return MakeQuicTag('Q', '0', '2', '3');
177 // This shold be an ERROR because we should never attempt to convert an
178 // invalid QuicVersion to be written to the wire.
179 LOG(ERROR
) << "Unsupported QuicVersion: " << version
;
184 QuicVersion
QuicTagToQuicVersion(const QuicTag version_tag
) {
185 for (size_t i
= 0; i
< arraysize(kSupportedQuicVersions
); ++i
) {
186 if (version_tag
== QuicVersionToQuicTag(kSupportedQuicVersions
[i
])) {
187 return kSupportedQuicVersions
[i
];
190 // Reading from the client so this should not be considered an ERROR.
191 DVLOG(1) << "Unsupported QuicTag version: "
192 << QuicUtils::TagToString(version_tag
);
193 return QUIC_VERSION_UNSUPPORTED
;
196 #define RETURN_STRING_LITERAL(x) \
200 string
QuicVersionToString(const QuicVersion version
) {
202 RETURN_STRING_LITERAL(QUIC_VERSION_16
);
203 RETURN_STRING_LITERAL(QUIC_VERSION_18
);
204 RETURN_STRING_LITERAL(QUIC_VERSION_19
);
205 RETURN_STRING_LITERAL(QUIC_VERSION_20
);
206 RETURN_STRING_LITERAL(QUIC_VERSION_21
);
207 RETURN_STRING_LITERAL(QUIC_VERSION_22
);
208 RETURN_STRING_LITERAL(QUIC_VERSION_23
);
210 return "QUIC_VERSION_UNSUPPORTED";
214 string
QuicVersionVectorToString(const QuicVersionVector
& versions
) {
216 for (size_t i
= 0; i
< versions
.size(); ++i
) {
220 result
.append(QuicVersionToString(versions
[i
]));
225 ostream
& operator<<(ostream
& os
, const QuicPacketHeader
& header
) {
226 os
<< "{ connection_id: " << header
.public_header
.connection_id
227 << ", connection_id_length:" << header
.public_header
.connection_id_length
228 << ", sequence_number_length:"
229 << header
.public_header
.sequence_number_length
230 << ", reset_flag: " << header
.public_header
.reset_flag
231 << ", version_flag: " << header
.public_header
.version_flag
;
232 if (header
.public_header
.version_flag
) {
234 for (size_t i
= 0; i
< header
.public_header
.versions
.size(); ++i
) {
235 os
<< header
.public_header
.versions
[0] << " ";
238 os
<< ", fec_flag: " << header
.fec_flag
239 << ", entropy_flag: " << header
.entropy_flag
240 << ", entropy hash: " << static_cast<int>(header
.entropy_hash
)
241 << ", sequence_number: " << header
.packet_sequence_number
242 << ", is_in_fec_group:" << header
.is_in_fec_group
243 << ", fec_group: " << header
.fec_group
<< "}\n";
247 bool IsAwaitingPacket(const QuicAckFrame
& ack_frame
,
248 QuicPacketSequenceNumber sequence_number
) {
249 return sequence_number
> ack_frame
.largest_observed
||
250 ContainsKey(ack_frame
.missing_packets
, sequence_number
);
253 void InsertMissingPacketsBetween(QuicAckFrame
* ack_frame
,
254 QuicPacketSequenceNumber lower
,
255 QuicPacketSequenceNumber higher
) {
256 for (QuicPacketSequenceNumber i
= lower
; i
< higher
; ++i
) {
257 ack_frame
->missing_packets
.insert(i
);
261 QuicStopWaitingFrame::QuicStopWaitingFrame()
266 QuicStopWaitingFrame::~QuicStopWaitingFrame() {}
268 QuicAckFrame::QuicAckFrame()
271 delta_time_largest_observed(QuicTime::Delta::Infinite()),
272 is_truncated(false) {}
274 QuicAckFrame::~QuicAckFrame() {}
276 CongestionFeedbackMessageTCP::CongestionFeedbackMessageTCP()
277 : receive_window(0) {
280 QuicCongestionFeedbackFrame::QuicCongestionFeedbackFrame() : type(kTCP
) {}
282 QuicCongestionFeedbackFrame::~QuicCongestionFeedbackFrame() {}
284 QuicRstStreamErrorCode
AdjustErrorForVersion(
285 QuicRstStreamErrorCode error_code
,
286 QuicVersion version
) {
287 switch (error_code
) {
288 case QUIC_RST_FLOW_CONTROL_ACCOUNTING
:
289 if (version
< QUIC_VERSION_18
) {
290 return QUIC_STREAM_NO_ERROR
;
299 QuicRstStreamFrame::QuicRstStreamFrame()
301 error_code(QUIC_STREAM_NO_ERROR
) {
304 QuicRstStreamFrame::QuicRstStreamFrame(QuicStreamId stream_id
,
305 QuicRstStreamErrorCode error_code
,
306 QuicStreamOffset bytes_written
)
307 : stream_id(stream_id
),
308 error_code(error_code
),
309 byte_offset(bytes_written
) {
310 DCHECK_LE(error_code
, numeric_limits
<uint8
>::max());
313 QuicConnectionCloseFrame::QuicConnectionCloseFrame()
314 : error_code(QUIC_NO_ERROR
) {
317 QuicFrame::QuicFrame() {}
319 QuicFrame::QuicFrame(QuicPaddingFrame
* padding_frame
)
320 : type(PADDING_FRAME
),
321 padding_frame(padding_frame
) {
324 QuicFrame::QuicFrame(QuicStreamFrame
* stream_frame
)
325 : type(STREAM_FRAME
),
326 stream_frame(stream_frame
) {
329 QuicFrame::QuicFrame(QuicAckFrame
* frame
)
334 QuicFrame::QuicFrame(QuicCongestionFeedbackFrame
* frame
)
335 : type(CONGESTION_FEEDBACK_FRAME
),
336 congestion_feedback_frame(frame
) {
339 QuicFrame::QuicFrame(QuicStopWaitingFrame
* frame
)
340 : type(STOP_WAITING_FRAME
),
341 stop_waiting_frame(frame
) {
344 QuicFrame::QuicFrame(QuicPingFrame
* frame
)
349 QuicFrame::QuicFrame(QuicRstStreamFrame
* frame
)
350 : type(RST_STREAM_FRAME
),
351 rst_stream_frame(frame
) {
354 QuicFrame::QuicFrame(QuicConnectionCloseFrame
* frame
)
355 : type(CONNECTION_CLOSE_FRAME
),
356 connection_close_frame(frame
) {
359 QuicFrame::QuicFrame(QuicGoAwayFrame
* frame
)
360 : type(GOAWAY_FRAME
),
361 goaway_frame(frame
) {
364 QuicFrame::QuicFrame(QuicWindowUpdateFrame
* frame
)
365 : type(WINDOW_UPDATE_FRAME
),
366 window_update_frame(frame
) {
369 QuicFrame::QuicFrame(QuicBlockedFrame
* frame
)
370 : type(BLOCKED_FRAME
),
371 blocked_frame(frame
) {
374 QuicFecData::QuicFecData() : fec_group(0) {}
376 ostream
& operator<<(ostream
& os
, const QuicStopWaitingFrame
& sent_info
) {
377 os
<< "entropy_hash: " << static_cast<int>(sent_info
.entropy_hash
)
378 << " least_unacked: " << sent_info
.least_unacked
;
382 ostream
& operator<<(ostream
& os
, const QuicAckFrame
& ack_frame
) {
383 os
<< "entropy_hash: " << static_cast<int>(ack_frame
.entropy_hash
)
384 << " largest_observed: " << ack_frame
.largest_observed
385 << " delta_time_largest_observed: "
386 << ack_frame
.delta_time_largest_observed
.ToMicroseconds()
387 << " missing_packets: [ ";
388 for (SequenceNumberSet::const_iterator it
= ack_frame
.missing_packets
.begin();
389 it
!= ack_frame
.missing_packets
.end(); ++it
) {
392 os
<< " ] is_truncated: " << ack_frame
.is_truncated
;
393 os
<< " revived_packets: [ ";
394 for (SequenceNumberSet::const_iterator it
= ack_frame
.revived_packets
.begin();
395 it
!= ack_frame
.revived_packets
.end(); ++it
) {
398 os
<< " ] received_packets: [ ";
399 for (PacketTimeList::const_iterator it
=
400 ack_frame
.received_packet_times
.begin();
401 it
!= ack_frame
.received_packet_times
.end(); ++it
) {
402 os
<< it
->first
<< " at " << it
->second
.ToDebuggingValue() << " ";
408 ostream
& operator<<(ostream
& os
, const QuicFrame
& frame
) {
409 switch (frame
.type
) {
410 case PADDING_FRAME
: {
411 os
<< "type { PADDING_FRAME } ";
414 case RST_STREAM_FRAME
: {
415 os
<< "type { " << RST_STREAM_FRAME
<< " } " << *(frame
.rst_stream_frame
);
418 case CONNECTION_CLOSE_FRAME
: {
419 os
<< "type { CONNECTION_CLOSE_FRAME } "
420 << *(frame
.connection_close_frame
);
424 os
<< "type { GOAWAY_FRAME } " << *(frame
.goaway_frame
);
427 case WINDOW_UPDATE_FRAME
: {
428 os
<< "type { WINDOW_UPDATE_FRAME } " << *(frame
.window_update_frame
);
431 case BLOCKED_FRAME
: {
432 os
<< "type { BLOCKED_FRAME } " << *(frame
.blocked_frame
);
436 os
<< "type { STREAM_FRAME } " << *(frame
.stream_frame
);
440 os
<< "type { ACK_FRAME } " << *(frame
.ack_frame
);
443 case CONGESTION_FEEDBACK_FRAME
: {
444 os
<< "type { CONGESTION_FEEDBACK_FRAME } "
445 << *(frame
.congestion_feedback_frame
);
448 case STOP_WAITING_FRAME
: {
449 os
<< "type { STOP_WAITING_FRAME } " << *(frame
.stop_waiting_frame
);
453 os
<< "type { PING_FRAME } ";
457 LOG(ERROR
) << "Unknown frame type: " << frame
.type
;
464 ostream
& operator<<(ostream
& os
, const QuicRstStreamFrame
& rst_frame
) {
465 os
<< "stream_id { " << rst_frame
.stream_id
<< " } "
466 << "error_code { " << rst_frame
.error_code
<< " } "
467 << "error_details { " << rst_frame
.error_details
<< " }\n";
471 ostream
& operator<<(ostream
& os
,
472 const QuicConnectionCloseFrame
& connection_close_frame
) {
473 os
<< "error_code { " << connection_close_frame
.error_code
<< " } "
474 << "error_details { " << connection_close_frame
.error_details
<< " }\n";
478 ostream
& operator<<(ostream
& os
, const QuicGoAwayFrame
& goaway_frame
) {
479 os
<< "error_code { " << goaway_frame
.error_code
<< " } "
480 << "last_good_stream_id { " << goaway_frame
.last_good_stream_id
<< " } "
481 << "reason_phrase { " << goaway_frame
.reason_phrase
<< " }\n";
485 ostream
& operator<<(ostream
& os
,
486 const QuicWindowUpdateFrame
& window_update_frame
) {
487 os
<< "stream_id { " << window_update_frame
.stream_id
<< " } "
488 << "byte_offset { " << window_update_frame
.byte_offset
<< " }\n";
492 ostream
& operator<<(ostream
& os
, const QuicBlockedFrame
& blocked_frame
) {
493 os
<< "stream_id { " << blocked_frame
.stream_id
<< " }\n";
497 ostream
& operator<<(ostream
& os
, const QuicStreamFrame
& stream_frame
) {
498 os
<< "stream_id { " << stream_frame
.stream_id
<< " } "
499 << "fin { " << stream_frame
.fin
<< " } "
500 << "offset { " << stream_frame
.offset
<< " } "
502 << QuicUtils::StringToHexASCIIDump(*(stream_frame
.GetDataAsString()))
507 ostream
& operator<<(ostream
& os
,
508 const QuicCongestionFeedbackFrame
& congestion_frame
) {
509 os
<< "type: " << congestion_frame
.type
;
510 switch (congestion_frame
.type
) {
512 const CongestionFeedbackMessageTCP
& tcp
= congestion_frame
.tcp
;
513 os
<< " receive_window: " << tcp
.receive_window
;
520 QuicGoAwayFrame::QuicGoAwayFrame()
521 : error_code(QUIC_NO_ERROR
),
522 last_good_stream_id(0) {
525 QuicGoAwayFrame::QuicGoAwayFrame(QuicErrorCode error_code
,
526 QuicStreamId last_good_stream_id
,
527 const string
& reason
)
528 : error_code(error_code
),
529 last_good_stream_id(last_good_stream_id
),
530 reason_phrase(reason
) {
531 DCHECK_LE(error_code
, numeric_limits
<uint8
>::max());
534 QuicData::QuicData(const char* buffer
,
538 owns_buffer_(false) {
541 QuicData::QuicData(char* buffer
,
546 owns_buffer_(owns_buffer
) {
549 QuicData::~QuicData() {
551 delete [] const_cast<char*>(buffer_
);
555 QuicWindowUpdateFrame::QuicWindowUpdateFrame(QuicStreamId stream_id
,
556 QuicStreamOffset byte_offset
)
557 : stream_id(stream_id
),
558 byte_offset(byte_offset
) {}
560 QuicBlockedFrame::QuicBlockedFrame(QuicStreamId stream_id
)
561 : stream_id(stream_id
) {}
563 QuicPacket::QuicPacket(char* buffer
,
566 QuicConnectionIdLength connection_id_length
,
567 bool includes_version
,
568 QuicSequenceNumberLength sequence_number_length
,
570 : QuicData(buffer
, length
, owns_buffer
),
572 is_fec_packet_(is_fec_packet
),
573 connection_id_length_(connection_id_length
),
574 includes_version_(includes_version
),
575 sequence_number_length_(sequence_number_length
) {
578 QuicEncryptedPacket::QuicEncryptedPacket(const char* buffer
,
580 : QuicData(buffer
, length
) {
583 QuicEncryptedPacket::QuicEncryptedPacket(char* buffer
,
586 : QuicData(buffer
, length
, owns_buffer
) {
589 StringPiece
QuicPacket::FecProtectedData() const {
590 const size_t start_of_fec
= GetStartOfFecProtectedData(
591 connection_id_length_
, includes_version_
, sequence_number_length_
);
592 return StringPiece(data() + start_of_fec
, length() - start_of_fec
);
595 StringPiece
QuicPacket::AssociatedData() const {
597 data() + kStartOfHashData
,
598 GetStartOfEncryptedData(
599 connection_id_length_
, includes_version_
, sequence_number_length_
) -
603 StringPiece
QuicPacket::BeforePlaintext() const {
604 return StringPiece(data(), GetStartOfEncryptedData(connection_id_length_
,
606 sequence_number_length_
));
609 StringPiece
QuicPacket::Plaintext() const {
610 const size_t start_of_encrypted_data
=
611 GetStartOfEncryptedData(
612 connection_id_length_
, includes_version_
, sequence_number_length_
);
613 return StringPiece(data() + start_of_encrypted_data
,
614 length() - start_of_encrypted_data
);
617 RetransmittableFrames::RetransmittableFrames()
618 : encryption_level_(NUM_ENCRYPTION_LEVELS
),
619 has_crypto_handshake_(NOT_HANDSHAKE
) {
622 RetransmittableFrames::~RetransmittableFrames() {
623 for (QuicFrames::iterator it
= frames_
.begin(); it
!= frames_
.end(); ++it
) {
626 delete it
->padding_frame
;
629 delete it
->stream_frame
;
632 delete it
->ack_frame
;
634 case CONGESTION_FEEDBACK_FRAME
:
635 delete it
->congestion_feedback_frame
;
637 case STOP_WAITING_FRAME
:
638 delete it
->stop_waiting_frame
;
641 delete it
->ping_frame
;
643 case RST_STREAM_FRAME
:
644 delete it
->rst_stream_frame
;
646 case CONNECTION_CLOSE_FRAME
:
647 delete it
->connection_close_frame
;
650 delete it
->goaway_frame
;
652 case WINDOW_UPDATE_FRAME
:
653 delete it
->window_update_frame
;
656 delete it
->blocked_frame
;
658 case NUM_FRAME_TYPES
:
659 DCHECK(false) << "Cannot delete type: " << it
->type
;
662 STLDeleteElements(&stream_data_
);
665 const QuicFrame
& RetransmittableFrames::AddStreamFrame(
666 QuicStreamFrame
* stream_frame
) {
667 // Make an owned copy of the stream frame's data.
668 stream_data_
.push_back(stream_frame
->GetDataAsString());
669 // Ensure the stream frame's IOVector points to the owned copy of the data.
670 stream_frame
->data
.Clear();
671 stream_frame
->data
.Append(const_cast<char*>(stream_data_
.back()->data()),
672 stream_data_
.back()->size());
673 frames_
.push_back(QuicFrame(stream_frame
));
674 if (stream_frame
->stream_id
== kCryptoStreamId
) {
675 has_crypto_handshake_
= IS_HANDSHAKE
;
677 return frames_
.back();
680 const QuicFrame
& RetransmittableFrames::AddNonStreamFrame(
681 const QuicFrame
& frame
) {
682 DCHECK_NE(frame
.type
, STREAM_FRAME
);
683 frames_
.push_back(frame
);
684 return frames_
.back();
687 void RetransmittableFrames::set_encryption_level(EncryptionLevel level
) {
688 encryption_level_
= level
;
691 SerializedPacket::SerializedPacket(
692 QuicPacketSequenceNumber sequence_number
,
693 QuicSequenceNumberLength sequence_number_length
,
695 QuicPacketEntropyHash entropy_hash
,
696 RetransmittableFrames
* retransmittable_frames
)
697 : sequence_number(sequence_number
),
698 sequence_number_length(sequence_number_length
),
700 entropy_hash(entropy_hash
),
701 retransmittable_frames(retransmittable_frames
) {
704 SerializedPacket::~SerializedPacket() {}
706 QuicEncryptedPacket
* QuicEncryptedPacket::Clone() const {
707 char* buffer
= new char[this->length()];
708 memcpy(buffer
, this->data(), this->length());
709 return new QuicEncryptedPacket(buffer
, this->length(), true);
712 ostream
& operator<<(ostream
& os
, const QuicEncryptedPacket
& s
) {
713 os
<< s
.length() << "-byte data";
717 TransmissionInfo::TransmissionInfo()
718 : retransmittable_frames(NULL
),
719 sequence_number_length(PACKET_1BYTE_SEQUENCE_NUMBER
),
720 sent_time(QuicTime::Zero()),
723 transmission_type(NOT_RETRANSMISSION
),
724 all_transmissions(NULL
),
727 TransmissionInfo::TransmissionInfo(
728 RetransmittableFrames
* retransmittable_frames
,
729 QuicPacketSequenceNumber sequence_number
,
730 QuicSequenceNumberLength sequence_number_length
)
731 : retransmittable_frames(retransmittable_frames
),
732 sequence_number_length(sequence_number_length
),
733 sent_time(QuicTime::Zero()),
736 transmission_type(NOT_RETRANSMISSION
),
737 all_transmissions(new SequenceNumberSet
),
739 all_transmissions
->insert(sequence_number
);
742 TransmissionInfo::TransmissionInfo(
743 RetransmittableFrames
* retransmittable_frames
,
744 QuicPacketSequenceNumber sequence_number
,
745 QuicSequenceNumberLength sequence_number_length
,
746 TransmissionType transmission_type
,
747 SequenceNumberSet
* all_transmissions
)
748 : retransmittable_frames(retransmittable_frames
),
749 sequence_number_length(sequence_number_length
),
750 sent_time(QuicTime::Zero()),
753 transmission_type(transmission_type
),
754 all_transmissions(all_transmissions
),
756 all_transmissions
->insert(sequence_number
);