blob: 74b18d2c4ac2c33d970d1df8bee3fa5758a6b17a [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,
25 QuicPacketNumberLength packet_number_length,
26 TransmissionType transmission_type,
27 QuicTime sent_time,
28 QuicPacketLength bytes_sent,
29 bool has_crypto_handshake,
30 int num_padding_bytes);
31
32 QuicTransmissionInfo(const QuicTransmissionInfo& other);
33
34 ~QuicTransmissionInfo();
35
36 QuicFrames retransmittable_frames;
37 EncryptionLevel encryption_level;
38 QuicPacketNumberLength packet_number_length;
39 QuicPacketLength bytes_sent;
40 QuicTime sent_time;
41 // Reason why this packet was transmitted.
42 TransmissionType transmission_type;
43 // In flight packets have not been abandoned or lost.
44 bool in_flight;
45 // State of this packet.
46 SentPacketState state;
47 // True if the packet contains stream data from the crypto stream.
48 bool has_crypto_handshake;
49 // Non-zero if the packet needs padding if it's retransmitted.
50 int16_t num_padding_bytes;
51 // Stores the packet number of the next retransmission of this packet.
52 // Zero if the packet has not been retransmitted.
53 // TODO(fayang): rename this to first_sent_after_loss_ when deprecating
54 // QUIC_VERSION_41.
55 QuicPacketNumber retransmission;
56 // The largest_acked in the ack frame, if the packet contains an ack.
57 QuicPacketNumber largest_acked;
58};
59// TODO(ianswett): Add static_assert when size of this struct is reduced below
60// 64 bytes.
61// NOTE(vlovich): Existing static_assert removed because padding differences on
62// 64-bit iOS resulted in an 88-byte struct that is greater than the 84-byte
63// limit on other platforms. Removing per ianswett's request.
64
65} // namespace quic
66
67#endif // QUICHE_QUIC_CORE_QUIC_TRANSMISSION_INFO_H_