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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 const QuicFrame& frame, | 282 const QuicFrame& frame, |
283 size_t free_bytes, | 283 size_t free_bytes, |
284 bool first_frame, | 284 bool first_frame, |
285 bool last_frame, | 285 bool last_frame, |
286 QuicSequenceNumberLength sequence_number_length); | 286 QuicSequenceNumberLength sequence_number_length); |
287 | 287 |
288 // Returns the associated data from the encrypted packet |encrypted| as a | 288 // Returns the associated data from the encrypted packet |encrypted| as a |
289 // stringpiece. | 289 // stringpiece. |
290 static base::StringPiece GetAssociatedDataFromEncryptedPacket( | 290 static base::StringPiece GetAssociatedDataFromEncryptedPacket( |
291 const QuicEncryptedPacket& encrypted, | 291 const QuicEncryptedPacket& encrypted, |
292 QuicGuidLength guid_length, | 292 QuicConnectionIdLength connection_id_length, |
293 bool includes_version, | 293 bool includes_version, |
294 QuicSequenceNumberLength sequence_number_length); | 294 QuicSequenceNumberLength sequence_number_length); |
295 | 295 |
296 // Returns a SerializedPacket whose |packet| member is owned by the caller, | 296 // Returns a SerializedPacket whose |packet| member is owned by the caller, |
297 // and is populated with the fields in |header| and |frames|, or is NULL if | 297 // and is populated with the fields in |header| and |frames|, or is NULL if |
298 // the packet could not be created. | 298 // the packet could not be created. |
299 // TODO(ianswett): Used for testing only. | 299 // TODO(ianswett): Used for testing only. |
300 SerializedPacket BuildUnsizedDataPacket(const QuicPacketHeader& header, | 300 SerializedPacket BuildUnsizedDataPacket(const QuicPacketHeader& header, |
301 const QuicFrames& frames); | 301 const QuicFrames& frames); |
302 | 302 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 485 |
486 std::string detailed_error_; | 486 std::string detailed_error_; |
487 scoped_ptr<QuicDataReader> reader_; | 487 scoped_ptr<QuicDataReader> reader_; |
488 QuicFramerVisitorInterface* visitor_; | 488 QuicFramerVisitorInterface* visitor_; |
489 QuicFecBuilderInterface* fec_builder_; | 489 QuicFecBuilderInterface* fec_builder_; |
490 QuicReceivedEntropyHashCalculatorInterface* entropy_calculator_; | 490 QuicReceivedEntropyHashCalculatorInterface* entropy_calculator_; |
491 QuicErrorCode error_; | 491 QuicErrorCode error_; |
492 // Updated by ProcessPacketHeader when it succeeds. | 492 // Updated by ProcessPacketHeader when it succeeds. |
493 QuicPacketSequenceNumber last_sequence_number_; | 493 QuicPacketSequenceNumber last_sequence_number_; |
494 // Updated by WritePacketHeader. | 494 // Updated by WritePacketHeader. |
495 QuicGuid last_serialized_guid_; | 495 QuicConnectionId last_serialized_connection_id_; |
496 // Buffer containing decrypted payload data during parsing. | 496 // Buffer containing decrypted payload data during parsing. |
497 scoped_ptr<QuicData> decrypted_; | 497 scoped_ptr<QuicData> decrypted_; |
498 // Version of the protocol being used. | 498 // Version of the protocol being used. |
499 QuicVersion quic_version_; | 499 QuicVersion quic_version_; |
500 // This vector contains QUIC versions which we currently support. | 500 // This vector contains QUIC versions which we currently support. |
501 // This should be ordered such that the highest supported version is the first | 501 // This should be ordered such that the highest supported version is the first |
502 // element, with subsequent elements in descending order (versions can be | 502 // element, with subsequent elements in descending order (versions can be |
503 // skipped as necessary). | 503 // skipped as necessary). |
504 QuicVersionVector supported_versions_; | 504 QuicVersionVector supported_versions_; |
505 // Primary decrypter used to decrypt packets during parsing. | 505 // Primary decrypter used to decrypt packets during parsing. |
(...skipping 12 matching lines...) Expand all Loading... |
518 // The time this frames was created. Time written to the wire will be | 518 // The time this frames was created. Time written to the wire will be |
519 // written as a delta from this value. | 519 // written as a delta from this value. |
520 QuicTime creation_time_; | 520 QuicTime creation_time_; |
521 | 521 |
522 DISALLOW_COPY_AND_ASSIGN(QuicFramer); | 522 DISALLOW_COPY_AND_ASSIGN(QuicFramer); |
523 }; | 523 }; |
524 | 524 |
525 } // namespace net | 525 } // namespace net |
526 | 526 |
527 #endif // NET_QUIC_QUIC_FRAMER_H_ | 527 #endif // NET_QUIC_QUIC_FRAMER_H_ |
OLD | NEW |