| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 QuicDecrypter* decrypter, | 300 QuicDecrypter* decrypter, |
| 301 bool latch_once_used); | 301 bool latch_once_used); |
| 302 | 302 |
| 303 const QuicDecrypter* decrypter() const; | 303 const QuicDecrypter* decrypter() const; |
| 304 const QuicDecrypter* alternative_decrypter() const; | 304 const QuicDecrypter* alternative_decrypter() const; |
| 305 | 305 |
| 306 // Changes the encrypter used for level |level| to |encrypter|. The function | 306 // Changes the encrypter used for level |level| to |encrypter|. The function |
| 307 // takes ownership of |encrypter|. | 307 // takes ownership of |encrypter|. |
| 308 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter); | 308 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter); |
| 309 | 309 |
| 310 // Encrypts a payload in |buffer|. |ad_len| is the length of the associated |
| 311 // data. |total_len| is the length of the associated data plus plaintext. |
| 312 // |buffer_len| is the full length of the allocated buffer. |
| 313 size_t EncryptInPlace(EncryptionLevel level, |
| 314 QuicPathId path_id, |
| 315 QuicPacketNumber packet_number, |
| 316 size_t ad_len, |
| 317 size_t total_len, |
| 318 size_t buffer_len, |
| 319 char* buffer); |
| 320 |
| 310 // Returns the length of the data encrypted into |buffer| if |buffer_len| is | 321 // Returns the length of the data encrypted into |buffer| if |buffer_len| is |
| 311 // long enough, and otherwise 0. | 322 // long enough, and otherwise 0. |
| 312 size_t EncryptPayload(EncryptionLevel level, | 323 size_t EncryptPayload(EncryptionLevel level, |
| 313 QuicPathId path_id, | 324 QuicPathId path_id, |
| 314 QuicPacketNumber packet_number, | 325 QuicPacketNumber packet_number, |
| 315 const QuicPacket& packet, | 326 const QuicPacket& packet, |
| 316 char* buffer, | 327 char* buffer, |
| 317 size_t buffer_len); | 328 size_t buffer_len); |
| 318 | 329 |
| 319 // Returns the maximum length of plaintext that can be encrypted | 330 // Returns the maximum length of plaintext that can be encrypted |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 // The time delta computed for the last timestamp frame. This is relative to | 554 // The time delta computed for the last timestamp frame. This is relative to |
| 544 // the creation_time. | 555 // the creation_time. |
| 545 QuicTime::Delta last_timestamp_; | 556 QuicTime::Delta last_timestamp_; |
| 546 | 557 |
| 547 DISALLOW_COPY_AND_ASSIGN(QuicFramer); | 558 DISALLOW_COPY_AND_ASSIGN(QuicFramer); |
| 548 }; | 559 }; |
| 549 | 560 |
| 550 } // namespace net | 561 } // namespace net |
| 551 | 562 |
| 552 #endif // NET_QUIC_QUIC_FRAMER_H_ | 563 #endif // NET_QUIC_QUIC_FRAMER_H_ |
| OLD | NEW |