QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 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. |
| 4 | |
fayang | 4245c21 | 2019-11-05 13:33:46 -0800 | [diff] [blame] | 5 | // Responsible for creating packets on behalf of a QuicConnection. |
| 6 | // Packets are serialized just-in-time. Stream data and control frames will be |
| 7 | // requested from the Connection just-in-time. Frames are accumulated into |
| 8 | // "current" packet until no more frames can fit, then current packet gets |
| 9 | // serialized and passed to connection via OnSerializedPacket(). |
| 10 | // |
| 11 | // Whether a packet should be serialized is determined by whether delegate is |
| 12 | // writable. If the Delegate is not writable, then no operations will cause |
| 13 | // a packet to be serialized. |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 14 | |
| 15 | #ifndef QUICHE_QUIC_CORE_QUIC_PACKET_CREATOR_H_ |
| 16 | #define QUICHE_QUIC_CORE_QUIC_PACKET_CREATOR_H_ |
| 17 | |
| 18 | #include <cstddef> |
| 19 | #include <memory> |
| 20 | #include <utility> |
| 21 | #include <vector> |
| 22 | |
vasilvv | 8f9591b | 2020-10-26 17:01:14 -0700 | [diff] [blame] | 23 | #include "absl/base/attributes.h" |
vasilvv | c872ee4 | 2020-10-07 19:50:22 -0700 | [diff] [blame] | 24 | #include "absl/strings/string_view.h" |
QUICHE team | 5be974e | 2020-12-29 18:35:24 -0500 | [diff] [blame] | 25 | #include "quic/core/frames/quic_stream_frame.h" |
| 26 | #include "quic/core/quic_circular_deque.h" |
| 27 | #include "quic/core/quic_coalesced_packet.h" |
| 28 | #include "quic/core/quic_framer.h" |
| 29 | #include "quic/core/quic_packets.h" |
| 30 | #include "quic/core/quic_types.h" |
| 31 | #include "quic/platform/api/quic_export.h" |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 32 | |
| 33 | namespace quic { |
| 34 | namespace test { |
| 35 | class QuicPacketCreatorPeer; |
| 36 | } |
| 37 | |
| 38 | class QUIC_EXPORT_PRIVATE QuicPacketCreator { |
| 39 | public: |
| 40 | // A delegate interface for further processing serialized packet. |
ianswett | b023c7b | 2019-05-06 12:38:10 -0700 | [diff] [blame] | 41 | class QUIC_EXPORT_PRIVATE DelegateInterface { |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 42 | public: |
ianswett | b023c7b | 2019-05-06 12:38:10 -0700 | [diff] [blame] | 43 | virtual ~DelegateInterface() {} |
dschinazi | 66dea07 | 2019-04-09 11:41:06 -0700 | [diff] [blame] | 44 | // Get a buffer of kMaxOutgoingPacketSize bytes to serialize the next |
wub | 50d4c71 | 2020-05-19 15:48:28 -0700 | [diff] [blame] | 45 | // packet. If the return value's buffer is nullptr, QuicPacketCreator will |
| 46 | // serialize on a stack buffer. |
| 47 | virtual QuicPacketBuffer GetPacketBuffer() = 0; |
wub | 8a5dafa | 2020-05-13 12:30:17 -0700 | [diff] [blame] | 48 | // Called when a packet is serialized. Delegate take the ownership of |
| 49 | // |serialized_packet|. |
| 50 | virtual void OnSerializedPacket(SerializedPacket serialized_packet) = 0; |
ianswett | b023c7b | 2019-05-06 12:38:10 -0700 | [diff] [blame] | 51 | |
| 52 | // Called when an unrecoverable error is encountered. |
| 53 | virtual void OnUnrecoverableError(QuicErrorCode error, |
fkastenholz | 85f1890 | 2019-05-28 12:47:00 -0700 | [diff] [blame] | 54 | const std::string& error_details) = 0; |
fayang | cad1179 | 2019-09-16 13:11:44 -0700 | [diff] [blame] | 55 | |
| 56 | // Consults delegate whether a packet should be generated. |
| 57 | virtual bool ShouldGeneratePacket(HasRetransmittableData retransmittable, |
| 58 | IsHandshake handshake) = 0; |
| 59 | // Called when there is data to be sent. Retrieves updated ACK frame from |
| 60 | // the delegate. |
| 61 | virtual const QuicFrames MaybeBundleAckOpportunistically() = 0; |
fayang | 1504296 | 2020-07-01 12:14:29 -0700 | [diff] [blame] | 62 | |
| 63 | // Returns the packet fate for serialized packets which will be handed over |
| 64 | // to delegate via OnSerializedPacket(). Called when a packet is about to be |
| 65 | // serialized. |
| 66 | virtual SerializedPacketFate GetSerializedPacketFate( |
| 67 | bool is_mtu_discovery, |
| 68 | EncryptionLevel encryption_level) = 0; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | // Interface which gets callbacks from the QuicPacketCreator at interesting |
| 72 | // points. Implementations must not mutate the state of the creator |
| 73 | // as a result of these callbacks. |
| 74 | class QUIC_EXPORT_PRIVATE DebugDelegate { |
| 75 | public: |
| 76 | virtual ~DebugDelegate() {} |
| 77 | |
| 78 | // Called when a frame has been added to the current packet. |
dschinazi | 17d4242 | 2019-06-18 16:35:07 -0700 | [diff] [blame] | 79 | virtual void OnFrameAddedToPacket(const QuicFrame& /*frame*/) {} |
renjietang | dbe9834 | 2019-10-18 11:00:57 -0700 | [diff] [blame] | 80 | |
| 81 | // Called when a stream frame is coalesced with an existing stream frame. |
| 82 | // |frame| is the new stream frame. |
| 83 | virtual void OnStreamFrameCoalesced(const QuicStreamFrame& /*frame*/) {} |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 84 | }; |
| 85 | |
danzh | 051bf77 | 2020-08-24 12:30:36 -0700 | [diff] [blame] | 86 | // Set the peer address which the serialized packet will be sent to during the |
| 87 | // scope of this object. Upon exiting the scope, the original peer address is |
| 88 | // restored. |
| 89 | class QUIC_EXPORT_PRIVATE ScopedPeerAddressContext { |
| 90 | public: |
| 91 | ScopedPeerAddressContext(QuicPacketCreator* creator, |
| 92 | QuicSocketAddress address); |
| 93 | ~ScopedPeerAddressContext(); |
| 94 | |
| 95 | private: |
| 96 | QuicPacketCreator* creator_; |
| 97 | QuicSocketAddress old_peer_address_; |
| 98 | }; |
| 99 | |
dschinazi | 7b9278c | 2019-05-20 07:36:21 -0700 | [diff] [blame] | 100 | QuicPacketCreator(QuicConnectionId server_connection_id, |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 101 | QuicFramer* framer, |
| 102 | DelegateInterface* delegate); |
dschinazi | 7b9278c | 2019-05-20 07:36:21 -0700 | [diff] [blame] | 103 | QuicPacketCreator(QuicConnectionId server_connection_id, |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 104 | QuicFramer* framer, |
| 105 | QuicRandom* random, |
| 106 | DelegateInterface* delegate); |
| 107 | QuicPacketCreator(const QuicPacketCreator&) = delete; |
| 108 | QuicPacketCreator& operator=(const QuicPacketCreator&) = delete; |
| 109 | |
| 110 | ~QuicPacketCreator(); |
| 111 | |
| 112 | // Makes the framer not serialize the protocol version in sent packets. |
| 113 | void StopSendingVersion(); |
| 114 | |
| 115 | // SetDiversificationNonce sets the nonce that will be sent in each public |
| 116 | // header of packets encrypted at the initial encryption level. Should only |
| 117 | // be called by servers. |
| 118 | void SetDiversificationNonce(const DiversificationNonce& nonce); |
| 119 | |
| 120 | // Update the packet number length to use in future packets as soon as it |
| 121 | // can be safely changed. |
| 122 | // TODO(fayang): Directly set packet number length instead of compute it in |
| 123 | // creator. |
| 124 | void UpdatePacketNumberLength(QuicPacketNumber least_packet_awaited_by_peer, |
| 125 | QuicPacketCount max_packets_in_flight); |
| 126 | |
fayang | 4c1c236 | 2019-09-13 07:20:01 -0700 | [diff] [blame] | 127 | // Skip |count| packet numbers. |
| 128 | void SkipNPacketNumbers(QuicPacketCount count, |
| 129 | QuicPacketNumber least_packet_awaited_by_peer, |
| 130 | QuicPacketCount max_packets_in_flight); |
| 131 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 132 | // The overhead the framing will add for a packet with one frame. |
| 133 | static size_t StreamFramePacketOverhead( |
| 134 | QuicTransportVersion version, |
| 135 | QuicConnectionIdLength destination_connection_id_length, |
| 136 | QuicConnectionIdLength source_connection_id_length, |
| 137 | bool include_version, |
| 138 | bool include_diversification_nonce, |
| 139 | QuicPacketNumberLength packet_number_length, |
| 140 | QuicVariableLengthIntegerLength retry_token_length_length, |
| 141 | QuicVariableLengthIntegerLength length_length, |
| 142 | QuicStreamOffset offset); |
| 143 | |
| 144 | // Returns false and flushes all pending frames if current open packet is |
| 145 | // full. |
| 146 | // If current packet is not full, creates a stream frame that fits into the |
| 147 | // open packet and adds it to the packet. |
fayang | 62b637b | 2019-09-16 08:40:49 -0700 | [diff] [blame] | 148 | bool ConsumeDataToFillCurrentPacket(QuicStreamId id, |
| 149 | size_t data_size, |
| 150 | QuicStreamOffset offset, |
| 151 | bool fin, |
| 152 | bool needs_full_padding, |
| 153 | TransmissionType transmission_type, |
| 154 | QuicFrame* frame); |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 155 | |
| 156 | // Creates a CRYPTO frame that fits into the current packet (which must be |
| 157 | // empty) and adds it to the packet. |
fayang | 62b637b | 2019-09-16 08:40:49 -0700 | [diff] [blame] | 158 | bool ConsumeCryptoDataToFillCurrentPacket(EncryptionLevel level, |
| 159 | size_t write_length, |
| 160 | QuicStreamOffset offset, |
| 161 | bool needs_full_padding, |
| 162 | TransmissionType transmission_type, |
| 163 | QuicFrame* frame); |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 164 | |
| 165 | // Returns true if current open packet can accommodate more stream frames of |
| 166 | // stream |id| at |offset| and data length |data_size|, false otherwise. |
fayang | 5a3cfcb | 2020-08-27 12:57:23 -0700 | [diff] [blame] | 167 | // TODO(fayang): mark this const by moving RemoveSoftMaxPacketLength out. |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 168 | bool HasRoomForStreamFrame(QuicStreamId id, |
| 169 | QuicStreamOffset offset, |
| 170 | size_t data_size); |
| 171 | |
| 172 | // Returns true if current open packet can accommodate a message frame of |
| 173 | // |length|. |
fayang | 5a3cfcb | 2020-08-27 12:57:23 -0700 | [diff] [blame] | 174 | // TODO(fayang): mark this const by moving RemoveSoftMaxPacketLength out. |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 175 | bool HasRoomForMessageFrame(QuicByteCount length); |
| 176 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 177 | // Serializes all added frames into a single packet and invokes the delegate_ |
| 178 | // to further process the SerializedPacket. |
fayang | 62b637b | 2019-09-16 08:40:49 -0700 | [diff] [blame] | 179 | void FlushCurrentPacket(); |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 180 | |
| 181 | // Optimized method to create a QuicStreamFrame and serialize it. Adds the |
| 182 | // QuicStreamFrame to the returned SerializedPacket. Sets |
| 183 | // |num_bytes_consumed| to the number of bytes consumed to create the |
| 184 | // QuicStreamFrame. |
| 185 | void CreateAndSerializeStreamFrame(QuicStreamId id, |
| 186 | size_t write_length, |
| 187 | QuicStreamOffset iov_offset, |
| 188 | QuicStreamOffset stream_offset, |
| 189 | bool fin, |
| 190 | TransmissionType transmission_type, |
| 191 | size_t* num_bytes_consumed); |
| 192 | |
| 193 | // Returns true if there are frames pending to be serialized. |
| 194 | bool HasPendingFrames() const; |
| 195 | |
| 196 | // Returns true if there are retransmittable frames pending to be serialized. |
| 197 | bool HasPendingRetransmittableFrames() const; |
| 198 | |
| 199 | // Returns true if there are stream frames for |id| pending to be serialized. |
| 200 | bool HasPendingStreamFramesOfStream(QuicStreamId id) const; |
| 201 | |
| 202 | // Returns the number of bytes which are available to be used by additional |
| 203 | // frames in the packet. Since stream frames are slightly smaller when they |
| 204 | // are the last frame in a packet, this method will return a different |
| 205 | // value than max_packet_size - PacketSize(), in this case. |
fayang | 5a3cfcb | 2020-08-27 12:57:23 -0700 | [diff] [blame] | 206 | size_t BytesFree() const; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 207 | |
| 208 | // Returns the number of bytes that the packet will expand by if a new frame |
| 209 | // is added to the packet. If the last frame was a stream frame, it will |
| 210 | // expand slightly when a new frame is added, and this method returns the |
| 211 | // amount of expected expansion. |
| 212 | size_t ExpansionOnNewFrame() const; |
| 213 | |
fayang | 54a38e3 | 2020-06-26 07:01:15 -0700 | [diff] [blame] | 214 | // Returns the number of bytes that the packet will expand by when a new frame |
| 215 | // is going to be added. |last_frame| is the last frame of the packet. |
bnc | e5c11c0 | 2020-07-29 08:02:21 -0700 | [diff] [blame] | 216 | static size_t ExpansionOnNewFrameWithLastFrame(const QuicFrame& last_frame, |
| 217 | QuicTransportVersion version); |
fayang | 54a38e3 | 2020-06-26 07:01:15 -0700 | [diff] [blame] | 218 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 219 | // Returns the number of bytes in the current packet, including the header, |
| 220 | // if serialized with the current frames. Adding a frame to the packet |
| 221 | // may change the serialized length of existing frames, as per the comment |
| 222 | // in BytesFree. |
fayang | 5a3cfcb | 2020-08-27 12:57:23 -0700 | [diff] [blame] | 223 | size_t PacketSize() const; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 224 | |
| 225 | // Tries to add |frame| to the packet creator's list of frames to be |
| 226 | // serialized. If the frame does not fit into the current packet, flushes the |
| 227 | // packet and returns false. |
renjietang | b63005e | 2019-11-19 23:08:53 -0800 | [diff] [blame] | 228 | bool AddFrame(const QuicFrame& frame, TransmissionType transmission_type); |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 229 | |
| 230 | // Identical to AddSavedFrame, but allows the frame to be padded. |
| 231 | bool AddPaddedSavedFrame(const QuicFrame& frame, |
| 232 | TransmissionType transmission_type); |
| 233 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 234 | // Creates a connectivity probing packet for versions prior to version 99. |
wub | 8a5dafa | 2020-05-13 12:30:17 -0700 | [diff] [blame] | 235 | std::unique_ptr<SerializedPacket> SerializeConnectivityProbingPacket(); |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 236 | |
| 237 | // Create connectivity probing request and response packets using PATH |
| 238 | // CHALLENGE and PATH RESPONSE frames, respectively, for version 99/IETF QUIC. |
| 239 | // SerializePathChallengeConnectivityProbingPacket will pad the packet to be |
| 240 | // MTU bytes long. |
wub | 8a5dafa | 2020-05-13 12:30:17 -0700 | [diff] [blame] | 241 | std::unique_ptr<SerializedPacket> |
danzh | 28ba472 | 2020-11-12 11:55:39 -0800 | [diff] [blame] | 242 | SerializePathChallengeConnectivityProbingPacket( |
| 243 | const QuicPathFrameBuffer& payload); |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 244 | |
| 245 | // If |is_padded| is true then SerializePathResponseConnectivityProbingPacket |
| 246 | // will pad the packet to be MTU bytes long, else it will not pad the packet. |
| 247 | // |payloads| is cleared. |
wub | 8a5dafa | 2020-05-13 12:30:17 -0700 | [diff] [blame] | 248 | std::unique_ptr<SerializedPacket> |
| 249 | SerializePathResponseConnectivityProbingPacket( |
wub | a750aab | 2020-02-10 06:43:15 -0800 | [diff] [blame] | 250 | const QuicCircularDeque<QuicPathFrameBuffer>& payloads, |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 251 | const bool is_padded); |
| 252 | |
danzh | 8a27a1a | 2020-09-02 10:26:28 -0700 | [diff] [blame] | 253 | // Add PATH_RESPONSE to current packet, flush before or afterwards if needed. |
| 254 | bool AddPathResponseFrame(const QuicPathFrameBuffer& data_buffer); |
| 255 | |
danzh | e919b00 | 2020-10-14 14:44:46 -0700 | [diff] [blame] | 256 | // Add PATH_CHALLENGE to current packet, flush before or afterwards if needed. |
| 257 | // This is a best effort adding. It may fail becasue of delegate state, but |
| 258 | // it's okay because of path validation retry mechanism. |
danzh | 28ba472 | 2020-11-12 11:55:39 -0800 | [diff] [blame] | 259 | void AddPathChallengeFrame(const QuicPathFrameBuffer& payload); |
danzh | e919b00 | 2020-10-14 14:44:46 -0700 | [diff] [blame] | 260 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 261 | // Returns a dummy packet that is valid but contains no useful information. |
| 262 | static SerializedPacket NoPacket(); |
| 263 | |
QUICHE team | 2252b70 | 2019-05-14 23:55:14 -0400 | [diff] [blame] | 264 | // Returns the destination connection ID to send over the wire. |
| 265 | QuicConnectionId GetDestinationConnectionId() const; |
| 266 | |
| 267 | // Returns the source connection ID to send over the wire. |
| 268 | QuicConnectionId GetSourceConnectionId() const; |
| 269 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 270 | // Returns length of destination connection ID to send over the wire. |
| 271 | QuicConnectionIdLength GetDestinationConnectionIdLength() const; |
| 272 | |
| 273 | // Returns length of source connection ID to send over the wire. |
| 274 | QuicConnectionIdLength GetSourceConnectionIdLength() const; |
| 275 | |
dschinazi | 7b9278c | 2019-05-20 07:36:21 -0700 | [diff] [blame] | 276 | // Sets whether the server connection ID should be sent over the wire. |
| 277 | void SetServerConnectionIdIncluded( |
| 278 | QuicConnectionIdIncluded server_connection_id_included); |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 279 | |
dschinazi | 8ff7482 | 2019-05-28 16:37:20 -0700 | [diff] [blame] | 280 | // Update the server connection ID used in outgoing packets. |
dschinazi | 7b9278c | 2019-05-20 07:36:21 -0700 | [diff] [blame] | 281 | void SetServerConnectionId(QuicConnectionId server_connection_id); |
QUICHE team | c65d1d1 | 2019-03-19 20:58:04 -0700 | [diff] [blame] | 282 | |
dschinazi | 346b7ce | 2019-06-05 01:38:18 -0700 | [diff] [blame] | 283 | // Update the client connection ID used in outgoing packets. |
| 284 | void SetClientConnectionId(QuicConnectionId client_connection_id); |
| 285 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 286 | // Sets the encryption level that will be applied to new packets. |
dschinazi | 87aad8a | 2020-08-26 17:02:02 -0700 | [diff] [blame] | 287 | void set_encryption_level(EncryptionLevel level); |
dschinazi | 6458eb3 | 2020-06-23 12:38:41 -0700 | [diff] [blame] | 288 | EncryptionLevel encryption_level() { return packet_.encryption_level; } |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 289 | |
| 290 | // packet number of the last created packet, or 0 if no packets have been |
| 291 | // created. |
| 292 | QuicPacketNumber packet_number() const { return packet_.packet_number; } |
| 293 | |
| 294 | QuicByteCount max_packet_length() const { return max_packet_length_; } |
| 295 | |
| 296 | bool has_ack() const { return packet_.has_ack; } |
| 297 | |
| 298 | bool has_stop_waiting() const { return packet_.has_stop_waiting; } |
| 299 | |
| 300 | // Sets the encrypter to use for the encryption level and updates the max |
| 301 | // plaintext size. |
| 302 | void SetEncrypter(EncryptionLevel level, |
| 303 | std::unique_ptr<QuicEncrypter> encrypter); |
| 304 | |
| 305 | // Indicates whether the packet creator is in a state where it can change |
| 306 | // current maximum packet length. |
| 307 | bool CanSetMaxPacketLength() const; |
| 308 | |
| 309 | // Sets the maximum packet length. |
| 310 | void SetMaxPacketLength(QuicByteCount length); |
| 311 | |
dschinazi | ed459c0 | 2020-05-07 16:12:23 -0700 | [diff] [blame] | 312 | // Sets the maximum DATAGRAM/MESSAGE frame size we can send. |
| 313 | void SetMaxDatagramFrameSize(QuicByteCount max_datagram_frame_size); |
| 314 | |
fayang | 2ab1e85 | 2019-11-04 11:24:36 -0800 | [diff] [blame] | 315 | // Set a soft maximum packet length in the creator. If a packet cannot be |
| 316 | // successfully created, creator will remove the soft limit and use the actual |
| 317 | // max packet length. |
| 318 | void SetSoftMaxPacketLength(QuicByteCount length); |
| 319 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 320 | // Increases pending_padding_bytes by |size|. Pending padding will be sent by |
| 321 | // MaybeAddPadding(). |
| 322 | void AddPendingPadding(QuicByteCount size); |
| 323 | |
dschinazi | 244f6dc | 2019-05-06 15:45:16 -0700 | [diff] [blame] | 324 | // Sets the retry token to be sent over the wire in IETF Initial packets. |
vasilvv | c872ee4 | 2020-10-07 19:50:22 -0700 | [diff] [blame] | 325 | void SetRetryToken(absl::string_view retry_token); |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 326 | |
fayang | 18be79a | 2019-09-16 15:17:12 -0700 | [diff] [blame] | 327 | // Consumes retransmittable control |frame|. Returns true if the frame is |
| 328 | // successfully consumed. Returns false otherwise. |
| 329 | bool ConsumeRetransmittableControlFrame(const QuicFrame& frame); |
| 330 | |
| 331 | // Given some data, may consume part or all of it and pass it to the |
| 332 | // packet creator to be serialized into packets. If not in batch |
| 333 | // mode, these packets will also be sent during this call. |
| 334 | // When |state| is FIN_AND_PADDING, random padding of size [1, 256] will be |
| 335 | // added after stream frames. If current constructed packet cannot |
| 336 | // accommodate, the padding will overflow to the next packet(s). |
| 337 | QuicConsumedData ConsumeData(QuicStreamId id, |
| 338 | size_t write_length, |
| 339 | QuicStreamOffset offset, |
| 340 | StreamSendingState state); |
| 341 | |
| 342 | // Sends as many data only packets as allowed by the send algorithm and the |
| 343 | // available iov. |
| 344 | // This path does not support padding, or bundling pending frames. |
| 345 | // In case we access this method from ConsumeData, total_bytes_consumed |
| 346 | // keeps track of how many bytes have already been consumed. |
| 347 | QuicConsumedData ConsumeDataFastPath(QuicStreamId id, |
| 348 | size_t write_length, |
| 349 | QuicStreamOffset offset, |
| 350 | bool fin, |
| 351 | size_t total_bytes_consumed); |
| 352 | |
| 353 | // Consumes data for CRYPTO frames sent at |level| starting at |offset| for a |
| 354 | // total of |write_length| bytes, and returns the number of bytes consumed. |
| 355 | // The data is passed into the packet creator and serialized into one or more |
| 356 | // packets. |
| 357 | size_t ConsumeCryptoData(EncryptionLevel level, |
| 358 | size_t write_length, |
| 359 | QuicStreamOffset offset); |
| 360 | |
| 361 | // Generates an MTU discovery packet of specified size. |
| 362 | void GenerateMtuDiscoveryPacket(QuicByteCount target_mtu); |
| 363 | |
| 364 | // Called when there is data to be sent, Retrieves updated ACK frame from |
| 365 | // delegate_ and flushes it. |
| 366 | void MaybeBundleAckOpportunistically(); |
| 367 | |
| 368 | // Called to flush ACK and STOP_WAITING frames, returns false if the flush |
| 369 | // fails. |
| 370 | bool FlushAckFrame(const QuicFrames& frames); |
| 371 | |
| 372 | // Adds a random amount of padding (between 1 to 256 bytes). |
| 373 | void AddRandomPadding(); |
| 374 | |
| 375 | // Attaches packet flusher. |
| 376 | void AttachPacketFlusher(); |
| 377 | |
| 378 | // Flushes everything, including current open packet and pending padding. |
| 379 | void Flush(); |
| 380 | |
| 381 | // Sends remaining pending padding. |
| 382 | // Pending paddings should only be sent when there is nothing else to send. |
| 383 | void SendRemainingPendingPadding(); |
| 384 | |
| 385 | // Set the minimum number of bytes for the server connection id length; |
| 386 | void SetServerConnectionIdLength(uint32_t length); |
| 387 | |
| 388 | // Set transmission type of next constructed packets. |
| 389 | void SetTransmissionType(TransmissionType type); |
| 390 | |
| 391 | // Tries to add a message frame containing |message| and returns the status. |
| 392 | MessageStatus AddMessageFrame(QuicMessageId message_id, |
| 393 | QuicMemSliceSpan message); |
| 394 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 395 | // Returns the largest payload that will fit into a single MESSAGE frame. |
ianswett | b239f86 | 2019-04-05 09:15:06 -0700 | [diff] [blame] | 396 | QuicPacketLength GetCurrentLargestMessagePayload() const; |
| 397 | // Returns the largest payload that will fit into a single MESSAGE frame at |
| 398 | // any point during the connection. This assumes the version and |
| 399 | // connection ID lengths do not change. |
| 400 | QuicPacketLength GetGuaranteedLargestMessagePayload() const; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 401 | |
fayang | 354c942 | 2019-05-21 08:10:35 -0700 | [diff] [blame] | 402 | // Packet number of next created packet. |
| 403 | QuicPacketNumber NextSendingPacketNumber() const; |
| 404 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 405 | void set_debug_delegate(DebugDelegate* debug_delegate) { |
| 406 | debug_delegate_ = debug_delegate; |
| 407 | } |
| 408 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 409 | QuicByteCount pending_padding_bytes() const { return pending_padding_bytes_; } |
| 410 | |
dschinazi | 5c1d7d8 | 2020-07-29 16:42:50 -0700 | [diff] [blame] | 411 | ParsedQuicVersion version() const { return framer_->version(); } |
| 412 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 413 | QuicTransportVersion transport_version() const { |
| 414 | return framer_->transport_version(); |
| 415 | } |
| 416 | |
nharper | 55fa613 | 2019-05-07 19:37:21 -0700 | [diff] [blame] | 417 | // Returns the minimum size that the plaintext of a packet must be. |
QUICHE team | 2252b70 | 2019-05-14 23:55:14 -0400 | [diff] [blame] | 418 | static size_t MinPlaintextPacketSize(const ParsedQuicVersion& version); |
nharper | 55fa613 | 2019-05-07 19:37:21 -0700 | [diff] [blame] | 419 | |
fayang | 18be79a | 2019-09-16 15:17:12 -0700 | [diff] [blame] | 420 | // Indicates whether packet flusher is currently attached. |
| 421 | bool PacketFlusherAttached() const; |
| 422 | |
nharper | 3907ac2 | 2019-09-25 15:32:28 -0700 | [diff] [blame] | 423 | void set_fully_pad_crypto_handshake_packets(bool new_value) { |
fayang | 18be79a | 2019-09-16 15:17:12 -0700 | [diff] [blame] | 424 | fully_pad_crypto_handshake_packets_ = new_value; |
| 425 | } |
| 426 | |
| 427 | bool fully_pad_crypto_handshake_packets() const { |
fayang | 18be79a | 2019-09-16 15:17:12 -0700 | [diff] [blame] | 428 | return fully_pad_crypto_handshake_packets_; |
| 429 | } |
| 430 | |
renjietang | 4c704c8 | 2019-10-07 16:39:11 -0700 | [diff] [blame] | 431 | // Serialize a probing packet that uses IETF QUIC's PATH CHALLENGE frame. Also |
| 432 | // fills the packet with padding. |
| 433 | size_t BuildPaddedPathChallengePacket(const QuicPacketHeader& header, |
| 434 | char* buffer, |
| 435 | size_t packet_length, |
danzh | 28ba472 | 2020-11-12 11:55:39 -0800 | [diff] [blame] | 436 | const QuicPathFrameBuffer& payload, |
renjietang | 4c704c8 | 2019-10-07 16:39:11 -0700 | [diff] [blame] | 437 | EncryptionLevel level); |
| 438 | |
| 439 | // Serialize a probing response packet that uses IETF QUIC's PATH RESPONSE |
| 440 | // frame. Also fills the packet with padding if |is_padded| is |
| 441 | // true. |payloads| is always emptied, even if the packet can not be |
| 442 | // successfully built. |
wub | a750aab | 2020-02-10 06:43:15 -0800 | [diff] [blame] | 443 | size_t BuildPathResponsePacket( |
| 444 | const QuicPacketHeader& header, |
| 445 | char* buffer, |
| 446 | size_t packet_length, |
| 447 | const QuicCircularDeque<QuicPathFrameBuffer>& payloads, |
| 448 | const bool is_padded, |
| 449 | EncryptionLevel level); |
renjietang | 4c704c8 | 2019-10-07 16:39:11 -0700 | [diff] [blame] | 450 | |
| 451 | // Serializes a probing packet, which is a padded PING packet. Returns the |
| 452 | // length of the packet. Returns 0 if it fails to serialize. |
| 453 | size_t BuildConnectivityProbingPacket(const QuicPacketHeader& header, |
| 454 | char* buffer, |
| 455 | size_t packet_length, |
| 456 | EncryptionLevel level); |
| 457 | |
fayang | 0875083 | 2019-10-24 11:25:34 -0700 | [diff] [blame] | 458 | // Serializes |coalesced| to provided |buffer|, returns coalesced packet |
| 459 | // length if serialization succeeds. Otherwise, returns 0. |
| 460 | size_t SerializeCoalescedPacket(const QuicCoalescedPacket& coalesced, |
| 461 | char* buffer, |
| 462 | size_t buffer_len); |
| 463 | |
fayang | fe963c5 | 2020-07-16 06:56:09 -0700 | [diff] [blame] | 464 | // Returns true if max_packet_length_ is currently a soft value. |
| 465 | bool HasSoftMaxPacketLength() const; |
| 466 | |
danzh | 051bf77 | 2020-08-24 12:30:36 -0700 | [diff] [blame] | 467 | // Use this address to sent to the peer from now on. If this address is |
| 468 | // different from the current one, flush all the queue frames first. |
| 469 | void SetDefaultPeerAddress(QuicSocketAddress address); |
| 470 | |
fayang | 133b868 | 2020-12-08 05:50:33 -0800 | [diff] [blame] | 471 | // Return true if retry_token_ is not empty. |
| 472 | bool HasRetryToken() const; |
| 473 | |
danzh | 9cb85b7 | 2020-12-30 07:17:09 -0800 | [diff] [blame] | 474 | const QuicSocketAddress& peer_address() const { return packet_.peer_address; } |
| 475 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 476 | private: |
| 477 | friend class test::QuicPacketCreatorPeer; |
| 478 | |
fayang | 04590fc | 2020-08-31 10:37:55 -0700 | [diff] [blame] | 479 | // Used to 1) clear queued_frames_, 2) report unrecoverable error (if |
| 480 | // serialization fails) upon exiting the scope. |
| 481 | class QUIC_EXPORT_PRIVATE ScopedSerializationFailureHandler { |
fayang | e447bc6 | 2020-08-27 13:47:11 -0700 | [diff] [blame] | 482 | public: |
fayang | 04590fc | 2020-08-31 10:37:55 -0700 | [diff] [blame] | 483 | explicit ScopedSerializationFailureHandler(QuicPacketCreator* creator); |
| 484 | ~ScopedSerializationFailureHandler(); |
fayang | e447bc6 | 2020-08-27 13:47:11 -0700 | [diff] [blame] | 485 | |
| 486 | private: |
| 487 | QuicPacketCreator* creator_; // Unowned. |
| 488 | }; |
| 489 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 490 | // Creates a stream frame which fits into the current open packet. If |
QUICHE team | f08778a | 2019-03-14 08:10:26 -0700 | [diff] [blame] | 491 | // |data_size| is 0 and fin is true, the expected behavior is to consume |
| 492 | // the fin. |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 493 | void CreateStreamFrame(QuicStreamId id, |
QUICHE team | f08778a | 2019-03-14 08:10:26 -0700 | [diff] [blame] | 494 | size_t data_size, |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 495 | QuicStreamOffset offset, |
| 496 | bool fin, |
| 497 | QuicFrame* frame); |
| 498 | |
| 499 | // Creates a CRYPTO frame which fits into the current open packet. Returns |
| 500 | // false if there isn't enough room in the current open packet for a CRYPTO |
| 501 | // frame, and true if there is. |
| 502 | bool CreateCryptoFrame(EncryptionLevel level, |
| 503 | size_t write_length, |
| 504 | QuicStreamOffset offset, |
| 505 | QuicFrame* frame); |
| 506 | |
| 507 | void FillPacketHeader(QuicPacketHeader* header); |
| 508 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 509 | // Adds a padding frame to the current packet (if there is space) when (1) |
| 510 | // current packet needs full padding or (2) there are pending paddings. |
| 511 | void MaybeAddPadding(); |
| 512 | |
| 513 | // Serializes all frames which have been added and adds any which should be |
| 514 | // retransmitted to packet_.retransmittable_frames. All frames must fit into |
fayang | 04590fc | 2020-08-31 10:37:55 -0700 | [diff] [blame] | 515 | // a single packet. Returns true on success, otherwise, returns false. |
| 516 | // Fails if |encrypted_buffer| is not large enough for the encrypted packet. |
vasilvv | 8f9591b | 2020-10-26 17:01:14 -0700 | [diff] [blame] | 517 | ABSL_MUST_USE_RESULT bool SerializePacket( |
fayang | 04590fc | 2020-08-31 10:37:55 -0700 | [diff] [blame] | 518 | QuicOwnedPacketBuffer encrypted_buffer, |
| 519 | size_t encrypted_buffer_len); |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 520 | |
| 521 | // Called after a new SerialiedPacket is created to call the delegate's |
| 522 | // OnSerializedPacket and reset state. |
| 523 | void OnSerializedPacket(); |
| 524 | |
| 525 | // Clears all fields of packet_ that should be cleared between serializations. |
| 526 | void ClearPacket(); |
| 527 | |
fayang | 0875083 | 2019-10-24 11:25:34 -0700 | [diff] [blame] | 528 | // Re-serialzes frames of ENCRYPTION_INITIAL packet in coalesced packet with |
| 529 | // the original packet's packet number and packet number length. |
| 530 | // |padding_size| indicates the size of necessary padding. Returns 0 if |
| 531 | // serialization fails. |
| 532 | size_t ReserializeInitialPacketInCoalescedPacket( |
| 533 | const SerializedPacket& packet, |
| 534 | size_t padding_size, |
| 535 | char* buffer, |
| 536 | size_t buffer_len); |
| 537 | |
renjietang | dbe9834 | 2019-10-18 11:00:57 -0700 | [diff] [blame] | 538 | // Tries to coalesce |frame| with the back of |queued_frames_|. |
| 539 | // Returns true on success. |
| 540 | bool MaybeCoalesceStreamFrame(const QuicStreamFrame& frame); |
| 541 | |
fayang | 2ab1e85 | 2019-11-04 11:24:36 -0800 | [diff] [blame] | 542 | // Called to remove the soft max_packet_length and restores |
| 543 | // latched_hard_max_packet_length_ if the packet cannot accommodate a single |
| 544 | // frame. Returns true if the soft limit is successfully removed. Returns |
| 545 | // false if either there is no current soft limit or there are queued frames |
| 546 | // (such that the packet length cannot be changed). |
| 547 | bool RemoveSoftMaxPacketLength(); |
| 548 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 549 | // Returns true if a diversification nonce should be included in the current |
| 550 | // packet's header. |
| 551 | bool IncludeNonceInPublicHeader() const; |
| 552 | |
| 553 | // Returns true if version should be included in current packet's header. |
| 554 | bool IncludeVersionInHeader() const; |
| 555 | |
| 556 | // Returns length of packet number to send over the wire. |
| 557 | // packet_.packet_number_length should never be read directly, use this |
| 558 | // function instead. |
| 559 | QuicPacketNumberLength GetPacketNumberLength() const; |
| 560 | |
nharper | 55fa613 | 2019-05-07 19:37:21 -0700 | [diff] [blame] | 561 | // Returns the size in bytes of the packet header. |
| 562 | size_t PacketHeaderSize() const; |
| 563 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 564 | // Returns whether the destination connection ID is sent over the wire. |
| 565 | QuicConnectionIdIncluded GetDestinationConnectionIdIncluded() const; |
| 566 | |
| 567 | // Returns whether the source connection ID is sent over the wire. |
| 568 | QuicConnectionIdIncluded GetSourceConnectionIdIncluded() const; |
| 569 | |
| 570 | // Returns length of the retry token variable length integer to send over the |
| 571 | // wire. Is non-zero for v99 IETF Initial packets. |
| 572 | QuicVariableLengthIntegerLength GetRetryTokenLengthLength() const; |
| 573 | |
| 574 | // Returns the retry token to send over the wire, only sent in |
| 575 | // v99 IETF Initial packets. |
vasilvv | c872ee4 | 2020-10-07 19:50:22 -0700 | [diff] [blame] | 576 | absl::string_view GetRetryToken() const; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 577 | |
| 578 | // Returns length of the length variable length integer to send over the |
| 579 | // wire. Is non-zero for v99 IETF Initial, 0-RTT or Handshake packets. |
| 580 | QuicVariableLengthIntegerLength GetLengthLength() const; |
| 581 | |
ianswett | e28f022 | 2019-04-04 13:31:22 -0700 | [diff] [blame] | 582 | // Returns true if |frame| is a ClientHello. |
| 583 | bool StreamFrameIsClientHello(const QuicStreamFrame& frame) const; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 584 | |
| 585 | // Returns true if packet under construction has IETF long header. |
| 586 | bool HasIetfLongHeader() const; |
| 587 | |
fayang | fce2f72 | 2020-06-26 10:27:32 -0700 | [diff] [blame] | 588 | // Get serialized frame length. Returns 0 if the frame does not fit into |
| 589 | // current packet. |
| 590 | size_t GetSerializedFrameLength(const QuicFrame& frame); |
| 591 | |
| 592 | // Add extra padding to pending_padding_bytes_ to meet minimum plaintext |
| 593 | // packet size required for header protection. |
| 594 | void MaybeAddExtraPaddingForHeaderProtection(); |
| 595 | |
fayang | 9320ca7 | 2020-08-03 13:02:59 -0700 | [diff] [blame] | 596 | // Returns true and close connection if it attempts to send unencrypted data. |
| 597 | bool AttemptingToSendUnencryptedStreamData(); |
| 598 | |
danzh | e919b00 | 2020-10-14 14:44:46 -0700 | [diff] [blame] | 599 | // Add the given frame to the current packet with full padding. If the current |
| 600 | // packet doesn't have enough space, flush once and try again. Return false if |
| 601 | // fail to add. |
| 602 | bool AddPaddedFrameWithRetry(const QuicFrame& frame); |
| 603 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 604 | // Does not own these delegates or the framer. |
| 605 | DelegateInterface* delegate_; |
| 606 | DebugDelegate* debug_delegate_; |
| 607 | QuicFramer* framer_; |
| 608 | QuicRandom* random_; |
| 609 | |
| 610 | // Controls whether version should be included while serializing the packet. |
| 611 | // send_version_in_packet_ should never be read directly, use |
| 612 | // IncludeVersionInHeader() instead. |
| 613 | bool send_version_in_packet_; |
| 614 | // If true, then |diversification_nonce_| will be included in the header of |
| 615 | // all packets created at the initial encryption level. |
| 616 | bool have_diversification_nonce_; |
| 617 | DiversificationNonce diversification_nonce_; |
| 618 | // Maximum length including headers and encryption (UDP payload length.) |
| 619 | QuicByteCount max_packet_length_; |
| 620 | size_t max_plaintext_size_; |
dschinazi | 7b9278c | 2019-05-20 07:36:21 -0700 | [diff] [blame] | 621 | // Whether the server_connection_id is sent over the wire. |
| 622 | QuicConnectionIdIncluded server_connection_id_included_; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 623 | |
| 624 | // Frames to be added to the next SerializedPacket |
| 625 | QuicFrames queued_frames_; |
| 626 | |
fayang | 7a06f9b | 2020-06-24 10:23:19 -0700 | [diff] [blame] | 627 | // Serialization size of header + frames. If there is no queued frames, |
| 628 | // packet_size_ is 0. |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 629 | // TODO(ianswett): Move packet_size_ into SerializedPacket once |
| 630 | // QuicEncryptedPacket has been flattened into SerializedPacket. |
| 631 | size_t packet_size_; |
dschinazi | 7b9278c | 2019-05-20 07:36:21 -0700 | [diff] [blame] | 632 | QuicConnectionId server_connection_id_; |
dschinazi | 346b7ce | 2019-06-05 01:38:18 -0700 | [diff] [blame] | 633 | QuicConnectionId client_connection_id_; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 634 | |
| 635 | // Packet used to invoke OnSerializedPacket. |
| 636 | SerializedPacket packet_; |
| 637 | |
| 638 | // Retry token to send over the wire in v99 IETF Initial packets. |
vasilvv | c48c871 | 2019-03-11 13:38:16 -0700 | [diff] [blame] | 639 | std::string retry_token_; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 640 | |
| 641 | // Pending padding bytes to send. Pending padding bytes will be sent in next |
| 642 | // packet(s) (after all other frames) if current constructed packet does not |
| 643 | // have room to send all of them. |
| 644 | QuicByteCount pending_padding_bytes_; |
| 645 | |
| 646 | // Indicates whether current constructed packet needs full padding to max |
| 647 | // packet size. Please note, full padding does not consume pending padding |
| 648 | // bytes. |
| 649 | bool needs_full_padding_; |
| 650 | |
fayang | 18be79a | 2019-09-16 15:17:12 -0700 | [diff] [blame] | 651 | // Transmission type of the next serialized packet. |
| 652 | TransmissionType next_transmission_type_; |
| 653 | |
| 654 | // True if packet flusher is currently attached. |
| 655 | bool flusher_attached_; |
| 656 | |
| 657 | // Whether crypto handshake packets should be fully padded. |
| 658 | bool fully_pad_crypto_handshake_packets_; |
| 659 | |
| 660 | // Packet number of the first packet of a write operation. This gets set |
| 661 | // when the out-most flusher attaches and gets cleared when the out-most |
| 662 | // flusher detaches. |
| 663 | QuicPacketNumber write_start_packet_number_; |
| 664 | |
fayang | 2ab1e85 | 2019-11-04 11:24:36 -0800 | [diff] [blame] | 665 | // If not 0, this latches the actual max_packet_length when |
| 666 | // SetSoftMaxPacketLength is called and max_packet_length_ gets |
| 667 | // set to a soft value. |
| 668 | QuicByteCount latched_hard_max_packet_length_; |
dschinazi | ed459c0 | 2020-05-07 16:12:23 -0700 | [diff] [blame] | 669 | |
| 670 | // The maximum length of a MESSAGE/DATAGRAM frame that our peer is willing to |
| 671 | // accept. There is no limit for QUIC_CRYPTO connections, but QUIC+TLS |
| 672 | // negotiates this during the handshake. |
| 673 | QuicByteCount max_datagram_frame_size_; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 674 | }; |
| 675 | |
| 676 | } // namespace quic |
| 677 | |
| 678 | #endif // QUICHE_QUIC_CORE_QUIC_PACKET_CREATOR_H_ |