| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_QUIC_QUIC_FRAMER_H_ | 5 #ifndef NET_QUIC_QUIC_FRAMER_H_ |
| 6 #define NET_QUIC_QUIC_FRAMER_H_ | 6 #define NET_QUIC_QUIC_FRAMER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 bool last_frame_in_packet, | 257 bool last_frame_in_packet, |
| 258 QuicPacketNumberLength packet_number_length); | 258 QuicPacketNumberLength packet_number_length); |
| 259 | 259 |
| 260 // Returns the associated data from the encrypted packet |encrypted| as a | 260 // Returns the associated data from the encrypted packet |encrypted| as a |
| 261 // stringpiece. | 261 // stringpiece. |
| 262 static base::StringPiece GetAssociatedDataFromEncryptedPacket( | 262 static base::StringPiece GetAssociatedDataFromEncryptedPacket( |
| 263 const QuicEncryptedPacket& encrypted, | 263 const QuicEncryptedPacket& encrypted, |
| 264 QuicConnectionIdLength connection_id_length, | 264 QuicConnectionIdLength connection_id_length, |
| 265 bool includes_version, | 265 bool includes_version, |
| 266 bool includes_path_id, | 266 bool includes_path_id, |
| 267 bool includes_diversification_nonce, |
| 267 QuicPacketNumberLength packet_number_length); | 268 QuicPacketNumberLength packet_number_length); |
| 268 | 269 |
| 269 // Serializes a packet containing |frames| into |buffer|. | 270 // Serializes a packet containing |frames| into |buffer|. |
| 270 // Returns the length of the packet, which must not be longer than | 271 // Returns the length of the packet, which must not be longer than |
| 271 // |packet_length|. Returns 0 if it fails to serialize. | 272 // |packet_length|. Returns 0 if it fails to serialize. |
| 272 size_t BuildDataPacket(const QuicPacketHeader& header, | 273 size_t BuildDataPacket(const QuicPacketHeader& header, |
| 273 const QuicFrames& frames, | 274 const QuicFrames& frames, |
| 274 char* buffer, | 275 char* buffer, |
| 275 size_t packet_length); | 276 size_t packet_length); |
| 276 | 277 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 // connection or the entity that initiated it. | 548 // connection or the entity that initiated it. |
| 548 Perspective perspective_; | 549 Perspective perspective_; |
| 549 // If false, skip validation that the public flags are set to legal values. | 550 // If false, skip validation that the public flags are set to legal values. |
| 550 bool validate_flags_; | 551 bool validate_flags_; |
| 551 // The time this framer was created. Time written to the wire will be | 552 // The time this framer was created. Time written to the wire will be |
| 552 // written as a delta from this value. | 553 // written as a delta from this value. |
| 553 QuicTime creation_time_; | 554 QuicTime creation_time_; |
| 554 // The time delta computed for the last timestamp frame. This is relative to | 555 // The time delta computed for the last timestamp frame. This is relative to |
| 555 // the creation_time. | 556 // the creation_time. |
| 556 QuicTime::Delta last_timestamp_; | 557 QuicTime::Delta last_timestamp_; |
| 558 // The diversification nonce from the last received packet. |
| 559 DiversificationNonce last_nonce_; |
| 557 | 560 |
| 558 DISALLOW_COPY_AND_ASSIGN(QuicFramer); | 561 DISALLOW_COPY_AND_ASSIGN(QuicFramer); |
| 559 }; | 562 }; |
| 560 | 563 |
| 561 } // namespace net | 564 } // namespace net |
| 562 | 565 |
| 563 #endif // NET_QUIC_QUIC_FRAMER_H_ | 566 #endif // NET_QUIC_QUIC_FRAMER_H_ |
| OLD | NEW |