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_15
:
163 return MakeQuicTag('Q', '0', '1', '5');
164 case QUIC_VERSION_16
:
165 return MakeQuicTag('Q', '0', '1', '6');
166 case QUIC_VERSION_18
:
167 return MakeQuicTag('Q', '0', '1', '8');
168 case QUIC_VERSION_19
:
169 return MakeQuicTag('Q', '0', '1', '9');
170 case QUIC_VERSION_20
:
171 return MakeQuicTag('Q', '0', '2', '0');
172 case QUIC_VERSION_21
:
173 return MakeQuicTag('Q', '0', '2', '1');
175 // This shold be an ERROR because we should never attempt to convert an
176 // invalid QuicVersion to be written to the wire.
177 LOG(ERROR
) << "Unsupported QuicVersion: " << version
;
182 QuicVersion
QuicTagToQuicVersion(const QuicTag version_tag
) {
183 for (size_t i
= 0; i
< arraysize(kSupportedQuicVersions
); ++i
) {
184 if (version_tag
== QuicVersionToQuicTag(kSupportedQuicVersions
[i
])) {
185 return kSupportedQuicVersions
[i
];
188 // Reading from the client so this should not be considered an ERROR.
189 DVLOG(1) << "Unsupported QuicTag version: "
190 << QuicUtils::TagToString(version_tag
);
191 return QUIC_VERSION_UNSUPPORTED
;
194 #define RETURN_STRING_LITERAL(x) \
198 string
QuicVersionToString(const QuicVersion version
) {
200 RETURN_STRING_LITERAL(QUIC_VERSION_15
);
201 RETURN_STRING_LITERAL(QUIC_VERSION_16
);
202 RETURN_STRING_LITERAL(QUIC_VERSION_18
);
203 RETURN_STRING_LITERAL(QUIC_VERSION_19
);
204 RETURN_STRING_LITERAL(QUIC_VERSION_20
);
205 RETURN_STRING_LITERAL(QUIC_VERSION_21
);
207 return "QUIC_VERSION_UNSUPPORTED";
211 string
QuicVersionVectorToString(const QuicVersionVector
& versions
) {
213 for (size_t i
= 0; i
< versions
.size(); ++i
) {
217 result
.append(QuicVersionToString(versions
[i
]));
222 ostream
& operator<<(ostream
& os
, const QuicPacketHeader
& header
) {
223 os
<< "{ connection_id: " << header
.public_header
.connection_id
224 << ", connection_id_length:" << header
.public_header
.connection_id_length
225 << ", sequence_number_length:"
226 << header
.public_header
.sequence_number_length
227 << ", reset_flag: " << header
.public_header
.reset_flag
228 << ", version_flag: " << header
.public_header
.version_flag
;
229 if (header
.public_header
.version_flag
) {
231 for (size_t i
= 0; i
< header
.public_header
.versions
.size(); ++i
) {
232 os
<< header
.public_header
.versions
[0] << " ";
235 os
<< ", fec_flag: " << header
.fec_flag
236 << ", entropy_flag: " << header
.entropy_flag
237 << ", entropy hash: " << static_cast<int>(header
.entropy_hash
)
238 << ", sequence_number: " << header
.packet_sequence_number
239 << ", is_in_fec_group:" << header
.is_in_fec_group
240 << ", fec_group: " << header
.fec_group
<< "}\n";
244 ReceivedPacketInfo::ReceivedPacketInfo()
247 delta_time_largest_observed(QuicTime::Delta::Infinite()),
248 is_truncated(false) {}
250 ReceivedPacketInfo::~ReceivedPacketInfo() {}
252 bool IsAwaitingPacket(const ReceivedPacketInfo
& received_info
,
253 QuicPacketSequenceNumber sequence_number
) {
254 return sequence_number
> received_info
.largest_observed
||
255 ContainsKey(received_info
.missing_packets
, sequence_number
);
258 void InsertMissingPacketsBetween(ReceivedPacketInfo
* received_info
,
259 QuicPacketSequenceNumber lower
,
260 QuicPacketSequenceNumber higher
) {
261 for (QuicPacketSequenceNumber i
= lower
; i
< higher
; ++i
) {
262 received_info
->missing_packets
.insert(i
);
266 QuicStopWaitingFrame::QuicStopWaitingFrame()
271 QuicStopWaitingFrame::~QuicStopWaitingFrame() {}
273 QuicAckFrame::QuicAckFrame() {}
275 CongestionFeedbackMessageTCP::CongestionFeedbackMessageTCP()
276 : receive_window(0) {
279 CongestionFeedbackMessageInterArrival::CongestionFeedbackMessageInterArrival() {
282 CongestionFeedbackMessageInterArrival::
283 ~CongestionFeedbackMessageInterArrival() {}
285 QuicCongestionFeedbackFrame::QuicCongestionFeedbackFrame() : type(kTCP
) {}
287 QuicCongestionFeedbackFrame::~QuicCongestionFeedbackFrame() {}
289 QuicRstStreamErrorCode
AdjustErrorForVersion(
290 QuicRstStreamErrorCode error_code
,
291 QuicVersion version
) {
292 switch (error_code
) {
293 case QUIC_RST_FLOW_CONTROL_ACCOUNTING
:
294 if (version
< QUIC_VERSION_18
) {
295 return QUIC_STREAM_NO_ERROR
;
304 QuicRstStreamFrame::QuicRstStreamFrame()
306 error_code(QUIC_STREAM_NO_ERROR
) {
309 QuicRstStreamFrame::QuicRstStreamFrame(QuicStreamId stream_id
,
310 QuicRstStreamErrorCode error_code
,
311 QuicStreamOffset bytes_written
)
312 : stream_id(stream_id
),
313 error_code(error_code
),
314 byte_offset(bytes_written
) {
315 DCHECK_LE(error_code
, numeric_limits
<uint8
>::max());
318 QuicConnectionCloseFrame::QuicConnectionCloseFrame()
319 : error_code(QUIC_NO_ERROR
) {
322 QuicFrame::QuicFrame() {}
324 QuicFrame::QuicFrame(QuicPaddingFrame
* padding_frame
)
325 : type(PADDING_FRAME
),
326 padding_frame(padding_frame
) {
329 QuicFrame::QuicFrame(QuicStreamFrame
* stream_frame
)
330 : type(STREAM_FRAME
),
331 stream_frame(stream_frame
) {
334 QuicFrame::QuicFrame(QuicAckFrame
* frame
)
339 QuicFrame::QuicFrame(QuicCongestionFeedbackFrame
* frame
)
340 : type(CONGESTION_FEEDBACK_FRAME
),
341 congestion_feedback_frame(frame
) {
344 QuicFrame::QuicFrame(QuicStopWaitingFrame
* frame
)
345 : type(STOP_WAITING_FRAME
),
346 stop_waiting_frame(frame
) {
349 QuicFrame::QuicFrame(QuicPingFrame
* frame
)
354 QuicFrame::QuicFrame(QuicRstStreamFrame
* frame
)
355 : type(RST_STREAM_FRAME
),
356 rst_stream_frame(frame
) {
359 QuicFrame::QuicFrame(QuicConnectionCloseFrame
* frame
)
360 : type(CONNECTION_CLOSE_FRAME
),
361 connection_close_frame(frame
) {
364 QuicFrame::QuicFrame(QuicGoAwayFrame
* frame
)
365 : type(GOAWAY_FRAME
),
366 goaway_frame(frame
) {
369 QuicFrame::QuicFrame(QuicWindowUpdateFrame
* frame
)
370 : type(WINDOW_UPDATE_FRAME
),
371 window_update_frame(frame
) {
374 QuicFrame::QuicFrame(QuicBlockedFrame
* frame
)
375 : type(BLOCKED_FRAME
),
376 blocked_frame(frame
) {
379 QuicFecData::QuicFecData() : fec_group(0) {}
381 ostream
& operator<<(ostream
& os
, const QuicStopWaitingFrame
& sent_info
) {
382 os
<< "entropy_hash: " << static_cast<int>(sent_info
.entropy_hash
)
383 << " least_unacked: " << sent_info
.least_unacked
;
387 ostream
& operator<<(ostream
& os
, const ReceivedPacketInfo
& received_info
) {
388 os
<< "entropy_hash: " << static_cast<int>(received_info
.entropy_hash
)
389 << " is_truncated: " << received_info
.is_truncated
390 << " largest_observed: " << received_info
.largest_observed
391 << " delta_time_largest_observed: "
392 << received_info
.delta_time_largest_observed
.ToMicroseconds()
393 << " missing_packets: [ ";
394 for (SequenceNumberSet::const_iterator it
=
395 received_info
.missing_packets
.begin();
396 it
!= received_info
.missing_packets
.end(); ++it
) {
399 os
<< " ] revived_packets: [ ";
400 for (SequenceNumberSet::const_iterator it
=
401 received_info
.revived_packets
.begin();
402 it
!= received_info
.revived_packets
.end(); ++it
) {
409 ostream
& operator<<(ostream
& os
, const QuicFrame
& frame
) {
410 switch (frame
.type
) {
411 case PADDING_FRAME
: {
412 os
<< "type { PADDING_FRAME } ";
415 case RST_STREAM_FRAME
: {
416 os
<< "type { " << RST_STREAM_FRAME
<< " } " << *(frame
.rst_stream_frame
);
419 case CONNECTION_CLOSE_FRAME
: {
420 os
<< "type { CONNECTION_CLOSE_FRAME } "
421 << *(frame
.connection_close_frame
);
425 os
<< "type { GOAWAY_FRAME } " << *(frame
.goaway_frame
);
428 case WINDOW_UPDATE_FRAME
: {
429 os
<< "type { WINDOW_UPDATE_FRAME } " << *(frame
.window_update_frame
);
432 case BLOCKED_FRAME
: {
433 os
<< "type { BLOCKED_FRAME } " << *(frame
.blocked_frame
);
437 os
<< "type { STREAM_FRAME } " << *(frame
.stream_frame
);
441 os
<< "type { ACK_FRAME } " << *(frame
.ack_frame
);
444 case CONGESTION_FEEDBACK_FRAME
: {
445 os
<< "type { CONGESTION_FEEDBACK_FRAME } "
446 << *(frame
.congestion_feedback_frame
);
449 case STOP_WAITING_FRAME
: {
450 os
<< "type { STOP_WAITING_FRAME } " << *(frame
.stop_waiting_frame
);
454 LOG(ERROR
) << "Unknown frame type: " << frame
.type
;
461 ostream
& operator<<(ostream
& os
, const QuicRstStreamFrame
& rst_frame
) {
462 os
<< "stream_id { " << rst_frame
.stream_id
<< " } "
463 << "error_code { " << rst_frame
.error_code
<< " } "
464 << "error_details { " << rst_frame
.error_details
<< " }\n";
468 ostream
& operator<<(ostream
& os
,
469 const QuicConnectionCloseFrame
& connection_close_frame
) {
470 os
<< "error_code { " << connection_close_frame
.error_code
<< " } "
471 << "error_details { " << connection_close_frame
.error_details
<< " }\n";
475 ostream
& operator<<(ostream
& os
, const QuicGoAwayFrame
& goaway_frame
) {
476 os
<< "error_code { " << goaway_frame
.error_code
<< " } "
477 << "last_good_stream_id { " << goaway_frame
.last_good_stream_id
<< " } "
478 << "reason_phrase { " << goaway_frame
.reason_phrase
<< " }\n";
482 ostream
& operator<<(ostream
& os
,
483 const QuicWindowUpdateFrame
& window_update_frame
) {
484 os
<< "stream_id { " << window_update_frame
.stream_id
<< " } "
485 << "byte_offset { " << window_update_frame
.byte_offset
<< " }\n";
489 ostream
& operator<<(ostream
& os
, const QuicBlockedFrame
& blocked_frame
) {
490 os
<< "stream_id { " << blocked_frame
.stream_id
<< " }\n";
494 ostream
& operator<<(ostream
& os
, const QuicStreamFrame
& stream_frame
) {
495 os
<< "stream_id { " << stream_frame
.stream_id
<< " } "
496 << "fin { " << stream_frame
.fin
<< " } "
497 << "offset { " << stream_frame
.offset
<< " } "
499 << QuicUtils::StringToHexASCIIDump(*(stream_frame
.GetDataAsString()))
504 ostream
& operator<<(ostream
& os
, const QuicAckFrame
& ack_frame
) {
505 os
<< "sent info { " << ack_frame
.sent_info
<< " } "
506 << "received info { " << ack_frame
.received_info
<< " }\n";
510 ostream
& operator<<(ostream
& os
,
511 const QuicCongestionFeedbackFrame
& congestion_frame
) {
512 os
<< "type: " << congestion_frame
.type
;
513 switch (congestion_frame
.type
) {
514 case kInterArrival
: {
515 const CongestionFeedbackMessageInterArrival
& inter_arrival
=
516 congestion_frame
.inter_arrival
;
517 os
<< " received packets: [ ";
518 for (TimeMap::const_iterator it
=
519 inter_arrival
.received_packet_times
.begin();
520 it
!= inter_arrival
.received_packet_times
.end(); ++it
) {
521 os
<< it
->first
<< "@" << it
->second
.ToDebuggingValue() << " ";
527 os
<< " bitrate_in_bytes_per_second: "
528 << congestion_frame
.fix_rate
.bitrate
.ToBytesPerSecond();
532 const CongestionFeedbackMessageTCP
& tcp
= congestion_frame
.tcp
;
533 os
<< " receive_window: " << tcp
.receive_window
;
537 LOG(DFATAL
) << "TCPBBR is not yet supported.";
544 CongestionFeedbackMessageFixRate::CongestionFeedbackMessageFixRate()
545 : bitrate(QuicBandwidth::Zero()) {
548 QuicGoAwayFrame::QuicGoAwayFrame()
549 : error_code(QUIC_NO_ERROR
),
550 last_good_stream_id(0) {
553 QuicGoAwayFrame::QuicGoAwayFrame(QuicErrorCode error_code
,
554 QuicStreamId last_good_stream_id
,
555 const string
& reason
)
556 : error_code(error_code
),
557 last_good_stream_id(last_good_stream_id
),
558 reason_phrase(reason
) {
559 DCHECK_LE(error_code
, numeric_limits
<uint8
>::max());
562 QuicData::QuicData(const char* buffer
,
566 owns_buffer_(false) {
569 QuicData::QuicData(char* buffer
,
574 owns_buffer_(owns_buffer
) {
577 QuicData::~QuicData() {
579 delete [] const_cast<char*>(buffer_
);
583 QuicWindowUpdateFrame::QuicWindowUpdateFrame(QuicStreamId stream_id
,
584 QuicStreamOffset byte_offset
)
585 : stream_id(stream_id
),
586 byte_offset(byte_offset
) {}
588 QuicBlockedFrame::QuicBlockedFrame(QuicStreamId stream_id
)
589 : stream_id(stream_id
) {}
591 QuicPacket::QuicPacket(char* buffer
,
594 QuicConnectionIdLength connection_id_length
,
595 bool includes_version
,
596 QuicSequenceNumberLength sequence_number_length
,
598 : QuicData(buffer
, length
, owns_buffer
),
600 is_fec_packet_(is_fec_packet
),
601 connection_id_length_(connection_id_length
),
602 includes_version_(includes_version
),
603 sequence_number_length_(sequence_number_length
) {
606 QuicEncryptedPacket::QuicEncryptedPacket(const char* buffer
,
608 : QuicData(buffer
, length
) {
611 QuicEncryptedPacket::QuicEncryptedPacket(char* buffer
,
614 : QuicData(buffer
, length
, owns_buffer
) {
617 StringPiece
QuicPacket::FecProtectedData() const {
618 const size_t start_of_fec
= GetStartOfFecProtectedData(
619 connection_id_length_
, includes_version_
, sequence_number_length_
);
620 return StringPiece(data() + start_of_fec
, length() - start_of_fec
);
623 StringPiece
QuicPacket::AssociatedData() const {
625 data() + kStartOfHashData
,
626 GetStartOfEncryptedData(
627 connection_id_length_
, includes_version_
, sequence_number_length_
) -
631 StringPiece
QuicPacket::BeforePlaintext() const {
632 return StringPiece(data(), GetStartOfEncryptedData(connection_id_length_
,
634 sequence_number_length_
));
637 StringPiece
QuicPacket::Plaintext() const {
638 const size_t start_of_encrypted_data
=
639 GetStartOfEncryptedData(
640 connection_id_length_
, includes_version_
, sequence_number_length_
);
641 return StringPiece(data() + start_of_encrypted_data
,
642 length() - start_of_encrypted_data
);
645 RetransmittableFrames::RetransmittableFrames()
646 : encryption_level_(NUM_ENCRYPTION_LEVELS
) {
649 RetransmittableFrames::~RetransmittableFrames() {
650 for (QuicFrames::iterator it
= frames_
.begin(); it
!= frames_
.end(); ++it
) {
653 delete it
->padding_frame
;
656 delete it
->stream_frame
;
659 delete it
->ack_frame
;
661 case CONGESTION_FEEDBACK_FRAME
:
662 delete it
->congestion_feedback_frame
;
664 case STOP_WAITING_FRAME
:
665 delete it
->stop_waiting_frame
;
668 delete it
->ping_frame
;
670 case RST_STREAM_FRAME
:
671 delete it
->rst_stream_frame
;
673 case CONNECTION_CLOSE_FRAME
:
674 delete it
->connection_close_frame
;
677 delete it
->goaway_frame
;
679 case WINDOW_UPDATE_FRAME
:
680 delete it
->window_update_frame
;
683 delete it
->blocked_frame
;
685 case NUM_FRAME_TYPES
:
686 DCHECK(false) << "Cannot delete type: " << it
->type
;
689 STLDeleteElements(&stream_data_
);
692 const QuicFrame
& RetransmittableFrames::AddStreamFrame(
693 QuicStreamFrame
* stream_frame
) {
694 // Make an owned copy of the stream frame's data.
695 stream_data_
.push_back(stream_frame
->GetDataAsString());
696 // Ensure the stream frame's IOVector points to the owned copy of the data.
697 stream_frame
->data
.Clear();
698 stream_frame
->data
.Append(const_cast<char*>(stream_data_
.back()->data()),
699 stream_data_
.back()->size());
700 frames_
.push_back(QuicFrame(stream_frame
));
701 return frames_
.back();
704 const QuicFrame
& RetransmittableFrames::AddNonStreamFrame(
705 const QuicFrame
& frame
) {
706 DCHECK_NE(frame
.type
, STREAM_FRAME
);
707 frames_
.push_back(frame
);
708 return frames_
.back();
711 IsHandshake
RetransmittableFrames::HasCryptoHandshake() const {
712 for (size_t i
= 0; i
< frames().size(); ++i
) {
713 if (frames()[i
].type
== STREAM_FRAME
&&
714 frames()[i
].stream_frame
->stream_id
== kCryptoStreamId
) {
718 return NOT_HANDSHAKE
;
721 void RetransmittableFrames::set_encryption_level(EncryptionLevel level
) {
722 encryption_level_
= level
;
725 SerializedPacket::SerializedPacket(
726 QuicPacketSequenceNumber sequence_number
,
727 QuicSequenceNumberLength sequence_number_length
,
729 QuicPacketEntropyHash entropy_hash
,
730 RetransmittableFrames
* retransmittable_frames
)
731 : sequence_number(sequence_number
),
732 sequence_number_length(sequence_number_length
),
734 entropy_hash(entropy_hash
),
735 retransmittable_frames(retransmittable_frames
) {
738 SerializedPacket::~SerializedPacket() {}
740 QuicEncryptedPacket
* QuicEncryptedPacket::Clone() const {
741 char* buffer
= new char[this->length()];
742 memcpy(buffer
, this->data(), this->length());
743 return new QuicEncryptedPacket(buffer
, this->length(), true);
746 ostream
& operator<<(ostream
& os
, const QuicEncryptedPacket
& s
) {
747 os
<< s
.length() << "-byte data";
751 TransmissionInfo::TransmissionInfo()
752 : retransmittable_frames(NULL
),
753 sequence_number_length(PACKET_1BYTE_SEQUENCE_NUMBER
),
754 sent_time(QuicTime::Zero()),
757 transmission_type(NOT_RETRANSMISSION
),
758 all_transmissions(NULL
),
761 TransmissionInfo::TransmissionInfo(
762 RetransmittableFrames
* retransmittable_frames
,
763 QuicPacketSequenceNumber sequence_number
,
764 QuicSequenceNumberLength sequence_number_length
)
765 : retransmittable_frames(retransmittable_frames
),
766 sequence_number_length(sequence_number_length
),
767 sent_time(QuicTime::Zero()),
770 transmission_type(NOT_RETRANSMISSION
),
771 all_transmissions(new SequenceNumberSet
),
773 all_transmissions
->insert(sequence_number
);
776 TransmissionInfo::TransmissionInfo(
777 RetransmittableFrames
* retransmittable_frames
,
778 QuicPacketSequenceNumber sequence_number
,
779 QuicSequenceNumberLength sequence_number_length
,
780 TransmissionType transmission_type
,
781 SequenceNumberSet
* all_transmissions
)
782 : retransmittable_frames(retransmittable_frames
),
783 sequence_number_length(sequence_number_length
),
784 sent_time(QuicTime::Zero()),
787 transmission_type(transmission_type
),
788 all_transmissions(all_transmissions
),
790 all_transmissions
->insert(sequence_number
);