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 // Some helpers for quic | 5 // Some helpers for quic |
6 | 6 |
7 #ifndef NET_QUIC_QUIC_UTILS_H_ | 7 #ifndef NET_QUIC_QUIC_UTILS_H_ |
8 #define NET_QUIC_QUIC_UTILS_H_ | 8 #define NET_QUIC_QUIC_UTILS_H_ |
9 | 9 |
| 10 #include "net/base/int128.h" |
10 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
11 #include "net/quic/quic_protocol.h" | 12 #include "net/quic/quic_protocol.h" |
12 #include "net/quic/uint128.h" | |
13 | 13 |
14 class IPAddress; | 14 class IPAddress; |
15 class IPEndPoint; | 15 class IPEndPoint; |
16 | 16 |
17 namespace gfe2 { | 17 namespace gfe2 { |
18 class BalsaHeaders; | 18 class BalsaHeaders; |
19 } | 19 } |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 class NET_EXPORT_PRIVATE QuicUtils { | 23 class NET_EXPORT_PRIVATE QuicUtils { |
24 public: | 24 public: |
25 // The overhead the quic framing will add for a packet with num_frames | 25 // The overhead the quic framing will add for a packet with num_frames |
26 // frames. | 26 // frames. |
27 static size_t StreamFramePacketOverhead(int num_frames); | 27 static size_t StreamFramePacketOverhead(int num_frames); |
28 | 28 |
29 // returns the 128 bit FNV1a hash of the data. See | 29 // returns the 128 bit FNV1a hash of the data. See |
30 // http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param | 30 // http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param |
31 static uint128 FNV1a_128_Hash(const char* data, int len); | 31 static uint128 FNV1a_128_Hash(const char* data, int len); |
32 | 32 |
33 // Returns the name of the quic error code as a char* | 33 // Returns the name of the quic error code as a char* |
34 static const char* ErrorToString(QuicErrorCode error); | 34 static const char* ErrorToString(QuicErrorCode error); |
35 }; | 35 }; |
36 | 36 |
37 } // namespace net | 37 } // namespace net |
38 | 38 |
39 #endif // NET_QUIC_QUIC_UTILS_H_ | 39 #endif // NET_QUIC_QUIC_UTILS_H_ |
OLD | NEW |