blob: a4fa762d3597ffa20cc5c9d22c351810abc3560f [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// Copyright (c) 2016 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.
4
5#ifndef QUICHE_QUIC_CORE_QUIC_TRANSMISSION_INFO_H_
6#define QUICHE_QUIC_CORE_QUIC_TRANSMISSION_INFO_H_
7
8#include <list>
9
10#include "net/third_party/quiche/src/quic/core/frames/quic_frame.h"
11#include "net/third_party/quiche/src/quic/core/quic_ack_listener_interface.h"
12#include "net/third_party/quiche/src/quic/core/quic_types.h"
13#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
14
15namespace quic {
16
17// Stores details of a single sent packet.
18struct QUIC_EXPORT_PRIVATE QuicTransmissionInfo {
19 // Used by STL when assigning into a map.
20 QuicTransmissionInfo();
21
22 // Constructs a Transmission with a new all_transmissions set
23 // containing |packet_number|.
24 QuicTransmissionInfo(EncryptionLevel level,
QUICHE teama6ef0a62019-03-07 20:34:33 -050025 TransmissionType transmission_type,
26 QuicTime sent_time,
27 QuicPacketLength bytes_sent,
28 bool has_crypto_handshake,
29 int num_padding_bytes);
30
31 QuicTransmissionInfo(const QuicTransmissionInfo& other);
32
33 ~QuicTransmissionInfo();
34
35 QuicFrames retransmittable_frames;
36 EncryptionLevel encryption_level;
QUICHE teama6ef0a62019-03-07 20:34:33 -050037 QuicPacketLength bytes_sent;
38 QuicTime sent_time;
39 // Reason why this packet was transmitted.
40 TransmissionType transmission_type;
41 // In flight packets have not been abandoned or lost.
42 bool in_flight;
43 // State of this packet.
44 SentPacketState state;
45 // True if the packet contains stream data from the crypto stream.
46 bool has_crypto_handshake;
47 // Non-zero if the packet needs padding if it's retransmitted.
48 int16_t num_padding_bytes;
49 // Stores the packet number of the next retransmission of this packet.
50 // Zero if the packet has not been retransmitted.
51 // TODO(fayang): rename this to first_sent_after_loss_ when deprecating
52 // QUIC_VERSION_41.
53 QuicPacketNumber retransmission;
54 // The largest_acked in the ack frame, if the packet contains an ack.
55 QuicPacketNumber largest_acked;
56};
57// TODO(ianswett): Add static_assert when size of this struct is reduced below
58// 64 bytes.
59// NOTE(vlovich): Existing static_assert removed because padding differences on
60// 64-bit iOS resulted in an 88-byte struct that is greater than the 84-byte
61// limit on other platforms. Removing per ianswett's request.
62
63} // namespace quic
64
65#endif // QUICHE_QUIC_CORE_QUIC_TRANSMISSION_INFO_H_