xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/quic_transmission_info.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // 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 "quiche/quic/core/frames/quic_frame.h"
11 #include "quiche/quic/core/quic_ack_listener_interface.h"
12 #include "quiche/quic/core/quic_types.h"
13 #include "quiche/quic/platform/api/quic_export.h"
14 
15 namespace quic {
16 
17 // Stores details of a single sent packet.
18 struct QUICHE_EXPORT 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,
25                        TransmissionType transmission_type, QuicTime sent_time,
26                        QuicPacketLength bytes_sent, bool has_crypto_handshake,
27                        bool has_ack_frequency, QuicEcnCodepoint ecn_codepoint);
28 
29   QuicTransmissionInfo(const QuicTransmissionInfo& other);
30 
31   ~QuicTransmissionInfo();
32 
33   std::string DebugString() const;
34 
35   QuicFrames retransmittable_frames;
36   QuicTime sent_time;
37   QuicPacketLength bytes_sent;
38   EncryptionLevel encryption_level;
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   // True if the packet contains ack frequency frame.
48   bool has_ack_frequency;
49   // Records the first sent packet after this packet was detected lost. Zero if
50   // this packet has not been detected lost. This is used to keep lost packet
51   // for another RTT (for potential spurious loss detection)
52   QuicPacketNumber first_sent_after_loss;
53   // The largest_acked in the ack frame, if the packet contains an ack.
54   QuicPacketNumber largest_acked;
55   // The ECN codepoint with which this packet was sent.
56   QuicEcnCodepoint ecn_codepoint;
57 };
58 // TODO(ianswett): Add static_assert when size of this struct is reduced below
59 // 64 bytes.
60 // NOTE(vlovich): Existing static_assert removed because padding differences on
61 // 64-bit iOS resulted in an 88-byte struct that is greater than the 84-byte
62 // limit on other platforms.  Removing per ianswett's request.
63 
64 }  // namespace quic
65 
66 #endif  // QUICHE_QUIC_CORE_QUIC_TRANSMISSION_INFO_H_
67