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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 QuicDecrypter* decrypter, | 325 QuicDecrypter* decrypter, |
326 bool latch_once_used); | 326 bool latch_once_used); |
327 | 327 |
328 const QuicDecrypter* decrypter() const; | 328 const QuicDecrypter* decrypter() const; |
329 const QuicDecrypter* alternative_decrypter() const; | 329 const QuicDecrypter* alternative_decrypter() const; |
330 | 330 |
331 // Changes the encrypter used for level |level| to |encrypter|. The function | 331 // Changes the encrypter used for level |level| to |encrypter|. The function |
332 // takes ownership of |encrypter|. | 332 // takes ownership of |encrypter|. |
333 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter); | 333 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter); |
334 | 334 |
335 // Returns a new encrypted packet, owned by the caller. | 335 // Returns the length of the data encrypted into |buffer| if |buffer_len| is |
336 // Encrypts into |buffer| if |buffer_len| is long enough, and otherwise | 336 // long enough, and otherwise 0. |
337 // constructs a new buffer owned by the EncryptedPacket. | 337 size_t EncryptPayload(EncryptionLevel level, |
338 QuicEncryptedPacket* EncryptPayload(EncryptionLevel level, | 338 QuicPacketNumber packet_number, |
339 QuicPacketNumber packet_number, | 339 const QuicPacket& packet, |
340 const QuicPacket& packet, | 340 char* buffer, |
341 char* buffer, | 341 size_t buffer_len); |
342 size_t buffer_len); | |
343 | 342 |
344 // Returns the maximum length of plaintext that can be encrypted | 343 // Returns the maximum length of plaintext that can be encrypted |
345 // to ciphertext no larger than |ciphertext_size|. | 344 // to ciphertext no larger than |ciphertext_size|. |
346 size_t GetMaxPlaintextSize(size_t ciphertext_size); | 345 size_t GetMaxPlaintextSize(size_t ciphertext_size); |
347 | 346 |
348 const std::string& detailed_error() { return detailed_error_; } | 347 const std::string& detailed_error() { return detailed_error_; } |
349 | 348 |
350 // The minimum packet number length required to represent |packet_number|. | 349 // The minimum packet number length required to represent |packet_number|. |
351 static QuicPacketNumberLength GetMinSequenceNumberLength( | 350 static QuicPacketNumberLength GetMinSequenceNumberLength( |
352 QuicPacketNumber packet_number); | 351 QuicPacketNumber packet_number); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 // The time delta computed for the last timestamp frame. This is relative to | 543 // The time delta computed for the last timestamp frame. This is relative to |
545 // the creation_time. | 544 // the creation_time. |
546 QuicTime::Delta last_timestamp_; | 545 QuicTime::Delta last_timestamp_; |
547 | 546 |
548 DISALLOW_COPY_AND_ASSIGN(QuicFramer); | 547 DISALLOW_COPY_AND_ASSIGN(QuicFramer); |
549 }; | 548 }; |
550 | 549 |
551 } // namespace net | 550 } // namespace net |
552 | 551 |
553 #endif // NET_QUIC_QUIC_FRAMER_H_ | 552 #endif // NET_QUIC_QUIC_FRAMER_H_ |
OLD | NEW |