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 #include "net/quic/quic_protocol.h" | 5 #include "net/quic/quic_protocol.h" |
6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
7 | 7 |
8 using base::StringPiece; | 8 using base::StringPiece; |
9 using std::map; | 9 using std::map; |
10 using std::numeric_limits; | 10 using std::numeric_limits; |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 size_t GetStartOfFecProtectedData(bool include_version) { | 27 size_t GetStartOfFecProtectedData(bool include_version) { |
28 return GetPacketHeaderSize(include_version); | 28 return GetPacketHeaderSize(include_version); |
29 } | 29 } |
30 | 30 |
31 size_t GetStartOfEncryptedData(bool include_version) { | 31 size_t GetStartOfEncryptedData(bool include_version) { |
32 return GetPacketHeaderSize(include_version) - kPrivateFlagsSize - | 32 return GetPacketHeaderSize(include_version) - kPrivateFlagsSize - |
33 kFecGroupSize; | 33 kFecGroupSize; |
34 } | 34 } |
35 | 35 |
| 36 uint32 MakeQuicTag(char a, char b, char c, char d) { |
| 37 return static_cast<uint32>(a) | |
| 38 static_cast<uint32>(b) << 8 | |
| 39 static_cast<uint32>(c) << 16 | |
| 40 static_cast<uint32>(d) << 24; |
| 41 } |
| 42 |
36 QuicPacketPublicHeader::QuicPacketPublicHeader() | 43 QuicPacketPublicHeader::QuicPacketPublicHeader() |
37 : guid(0), | 44 : guid(0), |
38 reset_flag(false), | 45 reset_flag(false), |
39 version_flag(false) { | 46 version_flag(false) { |
40 } | 47 } |
41 | 48 |
42 QuicPacketPublicHeader::QuicPacketPublicHeader( | 49 QuicPacketPublicHeader::QuicPacketPublicHeader( |
43 const QuicPacketPublicHeader& other) | 50 const QuicPacketPublicHeader& other) |
44 : guid(other.guid), | 51 : guid(other.guid), |
45 reset_flag(other.reset_flag), | 52 reset_flag(other.reset_flag), |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 return os; | 331 return os; |
325 } | 332 } |
326 | 333 |
327 ostream& operator<<(ostream& os, const QuicConsumedData& s) { | 334 ostream& operator<<(ostream& os, const QuicConsumedData& s) { |
328 os << "bytes_consumed: " << s.bytes_consumed | 335 os << "bytes_consumed: " << s.bytes_consumed |
329 << " fin_consumed: " << s.fin_consumed; | 336 << " fin_consumed: " << s.fin_consumed; |
330 return os; | 337 return os; |
331 } | 338 } |
332 | 339 |
333 } // namespace net | 340 } // namespace net |
OLD | NEW |