Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / net / quic / quic_protocol.cc
blobb631b07a22ec4ae6450ad43174dbef1840e36bc8
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;
11 using std::map;
12 using std::numeric_limits;
13 using std::ostream;
14 using std::string;
16 namespace net {
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,
26 bool include_version,
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,
36 bool include_version,
37 QuicSequenceNumberLength sequence_number_length) {
38 return GetPacketHeaderSize(connection_id_length,
39 include_version,
40 sequence_number_length,
41 IN_FEC_GROUP);
44 size_t GetStartOfEncryptedData(
45 QuicConnectionIdLength connection_id_length,
46 bool include_version,
47 QuicSequenceNumberLength sequence_number_length) {
48 // Don't include the fec size, since encryption starts before private flags.
49 return GetPacketHeaderSize(connection_id_length,
50 include_version,
51 sequence_number_length,
52 NOT_IN_FEC_GROUP) - kPrivateFlagsSize;
55 QuicPacketPublicHeader::QuicPacketPublicHeader()
56 : connection_id(0),
57 connection_id_length(PACKET_8BYTE_CONNECTION_ID),
58 reset_flag(false),
59 version_flag(false),
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()
76 : fec_flag(false),
77 entropy_flag(false),
78 entropy_hash(0),
79 packet_sequence_number(0),
80 is_in_fec_group(NOT_IN_FEC_GROUP),
81 fec_group(0) {
84 QuicPacketHeader::QuicPacketHeader(const QuicPacketPublicHeader& header)
85 : public_header(header),
86 fec_flag(false),
87 entropy_flag(false),
88 entropy_hash(0),
89 packet_sequence_number(0),
90 is_in_fec_group(NOT_IN_FEC_GROUP),
91 fec_group(0) {
94 QuicPublicResetPacket::QuicPublicResetPacket()
95 : nonce_proof(0),
96 rejected_sequence_number(0) {}
98 QuicPublicResetPacket::QuicPublicResetPacket(
99 const QuicPacketPublicHeader& header)
100 : public_header(header),
101 nonce_proof(0),
102 rejected_sequence_number(0) {}
104 QuicStreamFrame::QuicStreamFrame()
105 : stream_id(0),
106 fin(false),
107 offset(0),
108 notifier(nullptr) {}
110 QuicStreamFrame::QuicStreamFrame(const QuicStreamFrame& frame)
111 : stream_id(frame.stream_id),
112 fin(frame.fin),
113 offset(frame.offset),
114 data(frame.data),
115 notifier(frame.notifier) {
118 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id,
119 bool fin,
120 QuicStreamOffset offset,
121 IOVector data)
122 : stream_id(stream_id),
123 fin(fin),
124 offset(offset),
125 data(data),
126 notifier(nullptr) {}
128 string* QuicStreamFrame::GetDataAsString() const {
129 string* data_string = new string();
130 data_string->reserve(data.TotalBufferSize());
131 for (size_t i = 0; i < data.Size(); ++i) {
132 data_string->append(static_cast<char*>(data.iovec()[i].iov_base),
133 data.iovec()[i].iov_len);
135 DCHECK_EQ(data_string->size(), data.TotalBufferSize());
136 return data_string;
139 uint32 MakeQuicTag(char a, char b, char c, char d) {
140 return static_cast<uint32>(a) |
141 static_cast<uint32>(b) << 8 |
142 static_cast<uint32>(c) << 16 |
143 static_cast<uint32>(d) << 24;
146 bool ContainsQuicTag(const QuicTagVector& tag_vector, QuicTag tag) {
147 return std::find(tag_vector.begin(), tag_vector.end(), tag)
148 != tag_vector.end();
151 QuicVersionVector QuicSupportedVersions() {
152 QuicVersionVector supported_versions;
153 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) {
154 supported_versions.push_back(kSupportedQuicVersions[i]);
156 return supported_versions;
159 QuicTag QuicVersionToQuicTag(const QuicVersion version) {
160 switch (version) {
161 case QUIC_VERSION_19:
162 return MakeQuicTag('Q', '0', '1', '9');
163 case QUIC_VERSION_21:
164 return MakeQuicTag('Q', '0', '2', '1');
165 case QUIC_VERSION_22:
166 return MakeQuicTag('Q', '0', '2', '2');
167 case QUIC_VERSION_23:
168 return MakeQuicTag('Q', '0', '2', '3');
169 default:
170 // This shold be an ERROR because we should never attempt to convert an
171 // invalid QuicVersion to be written to the wire.
172 LOG(ERROR) << "Unsupported QuicVersion: " << version;
173 return 0;
177 QuicVersion QuicTagToQuicVersion(const QuicTag version_tag) {
178 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) {
179 if (version_tag == QuicVersionToQuicTag(kSupportedQuicVersions[i])) {
180 return kSupportedQuicVersions[i];
183 // Reading from the client so this should not be considered an ERROR.
184 DVLOG(1) << "Unsupported QuicTag version: "
185 << QuicUtils::TagToString(version_tag);
186 return QUIC_VERSION_UNSUPPORTED;
189 #define RETURN_STRING_LITERAL(x) \
190 case x: \
191 return #x
193 string QuicVersionToString(const QuicVersion version) {
194 switch (version) {
195 RETURN_STRING_LITERAL(QUIC_VERSION_19);
196 RETURN_STRING_LITERAL(QUIC_VERSION_21);
197 RETURN_STRING_LITERAL(QUIC_VERSION_22);
198 RETURN_STRING_LITERAL(QUIC_VERSION_23);
199 default:
200 return "QUIC_VERSION_UNSUPPORTED";
204 string QuicVersionVectorToString(const QuicVersionVector& versions) {
205 string result = "";
206 for (size_t i = 0; i < versions.size(); ++i) {
207 if (i != 0) {
208 result.append(",");
210 result.append(QuicVersionToString(versions[i]));
212 return result;
215 ostream& operator<<(ostream& os, const QuicPacketHeader& header) {
216 os << "{ connection_id: " << header.public_header.connection_id
217 << ", connection_id_length:" << header.public_header.connection_id_length
218 << ", sequence_number_length:"
219 << header.public_header.sequence_number_length
220 << ", reset_flag: " << header.public_header.reset_flag
221 << ", version_flag: " << header.public_header.version_flag;
222 if (header.public_header.version_flag) {
223 os << " version: ";
224 for (size_t i = 0; i < header.public_header.versions.size(); ++i) {
225 os << header.public_header.versions[0] << " ";
228 os << ", fec_flag: " << header.fec_flag
229 << ", entropy_flag: " << header.entropy_flag
230 << ", entropy hash: " << static_cast<int>(header.entropy_hash)
231 << ", sequence_number: " << header.packet_sequence_number
232 << ", is_in_fec_group:" << header.is_in_fec_group
233 << ", fec_group: " << header.fec_group<< "}\n";
234 return os;
237 bool IsAwaitingPacket(const QuicAckFrame& ack_frame,
238 QuicPacketSequenceNumber sequence_number) {
239 return sequence_number > ack_frame.largest_observed ||
240 ContainsKey(ack_frame.missing_packets, sequence_number);
243 void InsertMissingPacketsBetween(QuicAckFrame* ack_frame,
244 QuicPacketSequenceNumber lower,
245 QuicPacketSequenceNumber higher) {
246 for (QuicPacketSequenceNumber i = lower; i < higher; ++i) {
247 ack_frame->missing_packets.insert(i);
251 QuicStopWaitingFrame::QuicStopWaitingFrame()
252 : entropy_hash(0),
253 least_unacked(0) {
256 QuicStopWaitingFrame::~QuicStopWaitingFrame() {}
258 QuicAckFrame::QuicAckFrame()
259 : entropy_hash(0),
260 largest_observed(0),
261 delta_time_largest_observed(QuicTime::Delta::Infinite()),
262 is_truncated(false) {}
264 QuicAckFrame::~QuicAckFrame() {}
266 CongestionFeedbackMessageTCP::CongestionFeedbackMessageTCP()
267 : receive_window(0) {
270 QuicCongestionFeedbackFrame::QuicCongestionFeedbackFrame() : type(kTCP) {}
272 QuicCongestionFeedbackFrame::~QuicCongestionFeedbackFrame() {}
274 QuicRstStreamErrorCode AdjustErrorForVersion(
275 QuicRstStreamErrorCode error_code,
276 QuicVersion version) {
277 return error_code;
280 QuicRstStreamFrame::QuicRstStreamFrame()
281 : stream_id(0),
282 error_code(QUIC_STREAM_NO_ERROR) {
285 QuicRstStreamFrame::QuicRstStreamFrame(QuicStreamId stream_id,
286 QuicRstStreamErrorCode error_code,
287 QuicStreamOffset bytes_written)
288 : stream_id(stream_id),
289 error_code(error_code),
290 byte_offset(bytes_written) {
291 DCHECK_LE(error_code, numeric_limits<uint8>::max());
294 QuicConnectionCloseFrame::QuicConnectionCloseFrame()
295 : error_code(QUIC_NO_ERROR) {
298 QuicFrame::QuicFrame() {}
300 QuicFrame::QuicFrame(QuicPaddingFrame* padding_frame)
301 : type(PADDING_FRAME),
302 padding_frame(padding_frame) {
305 QuicFrame::QuicFrame(QuicStreamFrame* stream_frame)
306 : type(STREAM_FRAME),
307 stream_frame(stream_frame) {
310 QuicFrame::QuicFrame(QuicAckFrame* frame)
311 : type(ACK_FRAME),
312 ack_frame(frame) {
315 QuicFrame::QuicFrame(QuicCongestionFeedbackFrame* frame)
316 : type(CONGESTION_FEEDBACK_FRAME),
317 congestion_feedback_frame(frame) {
320 QuicFrame::QuicFrame(QuicStopWaitingFrame* frame)
321 : type(STOP_WAITING_FRAME),
322 stop_waiting_frame(frame) {
325 QuicFrame::QuicFrame(QuicPingFrame* frame)
326 : type(PING_FRAME),
327 ping_frame(frame) {
330 QuicFrame::QuicFrame(QuicRstStreamFrame* frame)
331 : type(RST_STREAM_FRAME),
332 rst_stream_frame(frame) {
335 QuicFrame::QuicFrame(QuicConnectionCloseFrame* frame)
336 : type(CONNECTION_CLOSE_FRAME),
337 connection_close_frame(frame) {
340 QuicFrame::QuicFrame(QuicGoAwayFrame* frame)
341 : type(GOAWAY_FRAME),
342 goaway_frame(frame) {
345 QuicFrame::QuicFrame(QuicWindowUpdateFrame* frame)
346 : type(WINDOW_UPDATE_FRAME),
347 window_update_frame(frame) {
350 QuicFrame::QuicFrame(QuicBlockedFrame* frame)
351 : type(BLOCKED_FRAME),
352 blocked_frame(frame) {
355 QuicFecData::QuicFecData() : fec_group(0) {}
357 ostream& operator<<(ostream& os, const QuicStopWaitingFrame& sent_info) {
358 os << "entropy_hash: " << static_cast<int>(sent_info.entropy_hash)
359 << " least_unacked: " << sent_info.least_unacked;
360 return os;
363 ostream& operator<<(ostream& os, const QuicAckFrame& ack_frame) {
364 os << "entropy_hash: " << static_cast<int>(ack_frame.entropy_hash)
365 << " largest_observed: " << ack_frame.largest_observed
366 << " delta_time_largest_observed: "
367 << ack_frame.delta_time_largest_observed.ToMicroseconds()
368 << " missing_packets: [ ";
369 for (SequenceNumberSet::const_iterator it = ack_frame.missing_packets.begin();
370 it != ack_frame.missing_packets.end(); ++it) {
371 os << *it << " ";
373 os << " ] is_truncated: " << ack_frame.is_truncated;
374 os << " revived_packets: [ ";
375 for (SequenceNumberSet::const_iterator it = ack_frame.revived_packets.begin();
376 it != ack_frame.revived_packets.end(); ++it) {
377 os << *it << " ";
379 os << " ] received_packets: [ ";
380 for (PacketTimeList::const_iterator it =
381 ack_frame.received_packet_times.begin();
382 it != ack_frame.received_packet_times.end(); ++it) {
383 os << it->first << " at " << it->second.ToDebuggingValue() << " ";
385 os << " ]";
386 return os;
389 ostream& operator<<(ostream& os, const QuicFrame& frame) {
390 switch (frame.type) {
391 case PADDING_FRAME: {
392 os << "type { PADDING_FRAME } ";
393 break;
395 case RST_STREAM_FRAME: {
396 os << "type { " << RST_STREAM_FRAME << " } " << *(frame.rst_stream_frame);
397 break;
399 case CONNECTION_CLOSE_FRAME: {
400 os << "type { CONNECTION_CLOSE_FRAME } "
401 << *(frame.connection_close_frame);
402 break;
404 case GOAWAY_FRAME: {
405 os << "type { GOAWAY_FRAME } " << *(frame.goaway_frame);
406 break;
408 case WINDOW_UPDATE_FRAME: {
409 os << "type { WINDOW_UPDATE_FRAME } " << *(frame.window_update_frame);
410 break;
412 case BLOCKED_FRAME: {
413 os << "type { BLOCKED_FRAME } " << *(frame.blocked_frame);
414 break;
416 case STREAM_FRAME: {
417 os << "type { STREAM_FRAME } " << *(frame.stream_frame);
418 break;
420 case ACK_FRAME: {
421 os << "type { ACK_FRAME } " << *(frame.ack_frame);
422 break;
424 case CONGESTION_FEEDBACK_FRAME: {
425 os << "type { CONGESTION_FEEDBACK_FRAME } "
426 << *(frame.congestion_feedback_frame);
427 break;
429 case STOP_WAITING_FRAME: {
430 os << "type { STOP_WAITING_FRAME } " << *(frame.stop_waiting_frame);
431 break;
433 case PING_FRAME: {
434 os << "type { PING_FRAME } ";
435 break;
437 default: {
438 LOG(ERROR) << "Unknown frame type: " << frame.type;
439 break;
442 return os;
445 ostream& operator<<(ostream& os, const QuicRstStreamFrame& rst_frame) {
446 os << "stream_id { " << rst_frame.stream_id << " } "
447 << "error_code { " << rst_frame.error_code << " } "
448 << "error_details { " << rst_frame.error_details << " }\n";
449 return os;
452 ostream& operator<<(ostream& os,
453 const QuicConnectionCloseFrame& connection_close_frame) {
454 os << "error_code { " << connection_close_frame.error_code << " } "
455 << "error_details { " << connection_close_frame.error_details << " }\n";
456 return os;
459 ostream& operator<<(ostream& os, const QuicGoAwayFrame& goaway_frame) {
460 os << "error_code { " << goaway_frame.error_code << " } "
461 << "last_good_stream_id { " << goaway_frame.last_good_stream_id << " } "
462 << "reason_phrase { " << goaway_frame.reason_phrase << " }\n";
463 return os;
466 ostream& operator<<(ostream& os,
467 const QuicWindowUpdateFrame& window_update_frame) {
468 os << "stream_id { " << window_update_frame.stream_id << " } "
469 << "byte_offset { " << window_update_frame.byte_offset << " }\n";
470 return os;
473 ostream& operator<<(ostream& os, const QuicBlockedFrame& blocked_frame) {
474 os << "stream_id { " << blocked_frame.stream_id << " }\n";
475 return os;
478 ostream& operator<<(ostream& os, const QuicStreamFrame& stream_frame) {
479 os << "stream_id { " << stream_frame.stream_id << " } "
480 << "fin { " << stream_frame.fin << " } "
481 << "offset { " << stream_frame.offset << " } "
482 << "data { "
483 << QuicUtils::StringToHexASCIIDump(*(stream_frame.GetDataAsString()))
484 << " }\n";
485 return os;
488 ostream& operator<<(ostream& os,
489 const QuicCongestionFeedbackFrame& congestion_frame) {
490 os << "type: " << congestion_frame.type;
491 switch (congestion_frame.type) {
492 case kTCP: {
493 const CongestionFeedbackMessageTCP& tcp = congestion_frame.tcp;
494 os << " receive_window: " << tcp.receive_window;
495 break;
498 return os;
501 QuicGoAwayFrame::QuicGoAwayFrame()
502 : error_code(QUIC_NO_ERROR),
503 last_good_stream_id(0) {
506 QuicGoAwayFrame::QuicGoAwayFrame(QuicErrorCode error_code,
507 QuicStreamId last_good_stream_id,
508 const string& reason)
509 : error_code(error_code),
510 last_good_stream_id(last_good_stream_id),
511 reason_phrase(reason) {
512 DCHECK_LE(error_code, numeric_limits<uint8>::max());
515 QuicData::QuicData(const char* buffer,
516 size_t length)
517 : buffer_(buffer),
518 length_(length),
519 owns_buffer_(false) {
522 QuicData::QuicData(char* buffer,
523 size_t length,
524 bool owns_buffer)
525 : buffer_(buffer),
526 length_(length),
527 owns_buffer_(owns_buffer) {
530 QuicData::~QuicData() {
531 if (owns_buffer_) {
532 delete [] const_cast<char*>(buffer_);
536 QuicWindowUpdateFrame::QuicWindowUpdateFrame(QuicStreamId stream_id,
537 QuicStreamOffset byte_offset)
538 : stream_id(stream_id),
539 byte_offset(byte_offset) {}
541 QuicBlockedFrame::QuicBlockedFrame(QuicStreamId stream_id)
542 : stream_id(stream_id) {}
544 QuicPacket::QuicPacket(char* buffer,
545 size_t length,
546 bool owns_buffer,
547 QuicConnectionIdLength connection_id_length,
548 bool includes_version,
549 QuicSequenceNumberLength sequence_number_length,
550 bool is_fec_packet)
551 : QuicData(buffer, length, owns_buffer),
552 buffer_(buffer),
553 is_fec_packet_(is_fec_packet),
554 connection_id_length_(connection_id_length),
555 includes_version_(includes_version),
556 sequence_number_length_(sequence_number_length) {
559 QuicEncryptedPacket::QuicEncryptedPacket(const char* buffer,
560 size_t length)
561 : QuicData(buffer, length) {
564 QuicEncryptedPacket::QuicEncryptedPacket(char* buffer,
565 size_t length,
566 bool owns_buffer)
567 : QuicData(buffer, length, owns_buffer) {
570 StringPiece QuicPacket::FecProtectedData() const {
571 const size_t start_of_fec = GetStartOfFecProtectedData(
572 connection_id_length_, includes_version_, sequence_number_length_);
573 return StringPiece(data() + start_of_fec, length() - start_of_fec);
576 StringPiece QuicPacket::AssociatedData() const {
577 return StringPiece(
578 data() + kStartOfHashData,
579 GetStartOfEncryptedData(
580 connection_id_length_, includes_version_, sequence_number_length_) -
581 kStartOfHashData);
584 StringPiece QuicPacket::BeforePlaintext() const {
585 return StringPiece(data(), GetStartOfEncryptedData(connection_id_length_,
586 includes_version_,
587 sequence_number_length_));
590 StringPiece QuicPacket::Plaintext() const {
591 const size_t start_of_encrypted_data =
592 GetStartOfEncryptedData(
593 connection_id_length_, includes_version_, sequence_number_length_);
594 return StringPiece(data() + start_of_encrypted_data,
595 length() - start_of_encrypted_data);
598 RetransmittableFrames::RetransmittableFrames()
599 : encryption_level_(NUM_ENCRYPTION_LEVELS),
600 has_crypto_handshake_(NOT_HANDSHAKE) {
603 RetransmittableFrames::~RetransmittableFrames() {
604 for (QuicFrames::iterator it = frames_.begin(); it != frames_.end(); ++it) {
605 switch (it->type) {
606 case PADDING_FRAME:
607 delete it->padding_frame;
608 break;
609 case STREAM_FRAME:
610 delete it->stream_frame;
611 break;
612 case ACK_FRAME:
613 delete it->ack_frame;
614 break;
615 case CONGESTION_FEEDBACK_FRAME:
616 delete it->congestion_feedback_frame;
617 break;
618 case STOP_WAITING_FRAME:
619 delete it->stop_waiting_frame;
620 break;
621 case PING_FRAME:
622 delete it->ping_frame;
623 break;
624 case RST_STREAM_FRAME:
625 delete it->rst_stream_frame;
626 break;
627 case CONNECTION_CLOSE_FRAME:
628 delete it->connection_close_frame;
629 break;
630 case GOAWAY_FRAME:
631 delete it->goaway_frame;
632 break;
633 case WINDOW_UPDATE_FRAME:
634 delete it->window_update_frame;
635 break;
636 case BLOCKED_FRAME:
637 delete it->blocked_frame;
638 break;
639 case NUM_FRAME_TYPES:
640 DCHECK(false) << "Cannot delete type: " << it->type;
643 STLDeleteElements(&stream_data_);
646 const QuicFrame& RetransmittableFrames::AddStreamFrame(
647 QuicStreamFrame* stream_frame) {
648 // Make an owned copy of the stream frame's data.
649 stream_data_.push_back(stream_frame->GetDataAsString());
650 // Ensure the stream frame's IOVector points to the owned copy of the data.
651 stream_frame->data.Clear();
652 stream_frame->data.Append(const_cast<char*>(stream_data_.back()->data()),
653 stream_data_.back()->size());
654 frames_.push_back(QuicFrame(stream_frame));
655 if (stream_frame->stream_id == kCryptoStreamId) {
656 has_crypto_handshake_ = IS_HANDSHAKE;
658 return frames_.back();
661 const QuicFrame& RetransmittableFrames::AddNonStreamFrame(
662 const QuicFrame& frame) {
663 DCHECK_NE(frame.type, STREAM_FRAME);
664 frames_.push_back(frame);
665 return frames_.back();
668 void RetransmittableFrames::set_encryption_level(EncryptionLevel level) {
669 encryption_level_ = level;
672 SerializedPacket::SerializedPacket(
673 QuicPacketSequenceNumber sequence_number,
674 QuicSequenceNumberLength sequence_number_length,
675 QuicPacket* packet,
676 QuicPacketEntropyHash entropy_hash,
677 RetransmittableFrames* retransmittable_frames)
678 : sequence_number(sequence_number),
679 sequence_number_length(sequence_number_length),
680 packet(packet),
681 entropy_hash(entropy_hash),
682 retransmittable_frames(retransmittable_frames) {
685 SerializedPacket::~SerializedPacket() {}
687 QuicEncryptedPacket* QuicEncryptedPacket::Clone() const {
688 char* buffer = new char[this->length()];
689 memcpy(buffer, this->data(), this->length());
690 return new QuicEncryptedPacket(buffer, this->length(), true);
693 ostream& operator<<(ostream& os, const QuicEncryptedPacket& s) {
694 os << s.length() << "-byte data";
695 return os;
698 TransmissionInfo::TransmissionInfo()
699 : retransmittable_frames(nullptr),
700 sequence_number_length(PACKET_1BYTE_SEQUENCE_NUMBER),
701 sent_time(QuicTime::Zero()),
702 bytes_sent(0),
703 nack_count(0),
704 transmission_type(NOT_RETRANSMISSION),
705 all_transmissions(nullptr),
706 in_flight(false),
707 is_unackable(false),
708 is_fec_packet(false) {}
710 TransmissionInfo::TransmissionInfo(
711 RetransmittableFrames* retransmittable_frames,
712 QuicSequenceNumberLength sequence_number_length,
713 TransmissionType transmission_type,
714 QuicTime sent_time)
715 : retransmittable_frames(retransmittable_frames),
716 sequence_number_length(sequence_number_length),
717 sent_time(sent_time),
718 bytes_sent(0),
719 nack_count(0),
720 transmission_type(transmission_type),
721 all_transmissions(nullptr),
722 in_flight(false),
723 is_unackable(false),
724 is_fec_packet(false) {}
726 } // namespace net