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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // num_consumed to the number of frames consumed constructing the packet. | 147 // num_consumed to the number of frames consumed constructing the packet. |
148 QuicPacket* ConstructMaxFrameDataPacket(const QuicPacketHeader& header, | 148 QuicPacket* ConstructMaxFrameDataPacket(const QuicPacketHeader& header, |
149 const QuicFrames& frames, | 149 const QuicFrames& frames, |
150 size_t* num_consumed); | 150 size_t* num_consumed); |
151 | 151 |
152 // Returns a new QuicPacket, owned by the caller, populated with the fields | 152 // Returns a new QuicPacket, owned by the caller, populated with the fields |
153 // in |header| and |fec|, or NULL if the packet could not be created. | 153 // in |header| and |fec|, or NULL if the packet could not be created. |
154 QuicPacket* ConstructFecPacket(const QuicPacketHeader& header, | 154 QuicPacket* ConstructFecPacket(const QuicPacketHeader& header, |
155 const QuicFecData& fec); | 155 const QuicFecData& fec); |
156 | 156 |
157 void WriteSequenceNumber(QuicPacketSequenceNumber sequence_number, | |
158 QuicPacket* packet); | |
159 | |
160 void WriteFecGroup(QuicFecGroupNumber fec_group, QuicPacket* packet); | |
161 | |
162 // Returns a new encrypted packet, owned by the caller. | 157 // Returns a new encrypted packet, owned by the caller. |
163 QuicEncryptedPacket* EncryptPacket(const QuicPacket& packet); | 158 QuicEncryptedPacket* EncryptPacket(const QuicPacket& packet); |
164 | 159 |
165 // Returns the maximum length of plaintext that can be encrypted | 160 // Returns the maximum length of plaintext that can be encrypted |
166 // to ciphertext no larger than |ciphertext_size|. | 161 // to ciphertext no larger than |ciphertext_size|. |
167 size_t GetMaxPlaintextSize(size_t ciphertext_size); | 162 size_t GetMaxPlaintextSize(size_t ciphertext_size); |
168 | 163 |
169 const std::string& detailed_error() { return detailed_error_; } | 164 const std::string& detailed_error() { return detailed_error_; } |
170 | 165 |
171 private: | 166 private: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 scoped_ptr<QuicDecrypter> decrypter_; | 219 scoped_ptr<QuicDecrypter> decrypter_; |
225 // Encrypter used to encrypt packets via EncryptPacket(). | 220 // Encrypter used to encrypt packets via EncryptPacket(). |
226 scoped_ptr<QuicEncrypter> encrypter_; | 221 scoped_ptr<QuicEncrypter> encrypter_; |
227 | 222 |
228 DISALLOW_COPY_AND_ASSIGN(QuicFramer); | 223 DISALLOW_COPY_AND_ASSIGN(QuicFramer); |
229 }; | 224 }; |
230 | 225 |
231 } // namespace net | 226 } // namespace net |
232 | 227 |
233 #endif // NET_QUIC_QUIC_FRAMER_H_ | 228 #endif // NET_QUIC_QUIC_FRAMER_H_ |
OLD | NEW |