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_CORE_QUIC_UTILS_H_ | 7 #ifndef NET_QUIC_CORE_QUIC_UTILS_H_ |
8 #define NET_QUIC_CORE_QUIC_UTILS_H_ | 8 #define NET_QUIC_CORE_QUIC_UTILS_H_ |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param | 44 // http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param |
45 static uint128 FNV1a_128_Hash_Two(const char* data1, | 45 static uint128 FNV1a_128_Hash_Two(const char* data1, |
46 int len1, | 46 int len1, |
47 const char* data2, | 47 const char* data2, |
48 int len2); | 48 int len2); |
49 | 49 |
50 // SerializeUint128 writes the first 96 bits of |v| in little-endian form | 50 // SerializeUint128 writes the first 96 bits of |v| in little-endian form |
51 // to |out|. | 51 // to |out|. |
52 static void SerializeUint128Short(uint128 v, uint8_t* out); | 52 static void SerializeUint128Short(uint128 v, uint8_t* out); |
53 | 53 |
54 // Returns the name of the QuicRstStreamErrorCode as a char* | |
55 static const char* StreamErrorToString(QuicRstStreamErrorCode error); | |
56 | |
57 // Returns the name of the QuicErrorCode as a char* | |
58 static const char* ErrorToString(QuicErrorCode error); | |
59 | |
60 // Returns the level of encryption as a char* | 54 // Returns the level of encryption as a char* |
61 static const char* EncryptionLevelToString(EncryptionLevel level); | 55 static const char* EncryptionLevelToString(EncryptionLevel level); |
62 | 56 |
63 // Returns TransmissionType as a char* | 57 // Returns TransmissionType as a char* |
64 static const char* TransmissionTypeToString(TransmissionType type); | 58 static const char* TransmissionTypeToString(TransmissionType type); |
65 | 59 |
66 // Returns the list of QUIC tags represented by the comma separated | 60 // Returns the list of QUIC tags represented by the comma separated |
67 // string in |connection_options|. | 61 // string in |connection_options|. |
68 static QuicTagVector ParseQuicConnectionOptions( | 62 static QuicTagVector ParseQuicConnectionOptions( |
69 const std::string& connection_options); | 63 const std::string& connection_options); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // "0x0000: 4865 6c6c 6f2c 2051 5549 4321 0102 0304 Hello,.QUIC!...." | 105 // "0x0000: 4865 6c6c 6f2c 2051 5549 4321 0102 0304 Hello,.QUIC!...." |
112 static std::string HexDump(base::StringPiece binary_data); | 106 static std::string HexDump(base::StringPiece binary_data); |
113 | 107 |
114 private: | 108 private: |
115 DISALLOW_COPY_AND_ASSIGN(QuicUtils); | 109 DISALLOW_COPY_AND_ASSIGN(QuicUtils); |
116 }; | 110 }; |
117 | 111 |
118 } // namespace net | 112 } // namespace net |
119 | 113 |
120 #endif // NET_QUIC_CORE_QUIC_UTILS_H_ | 114 #endif // NET_QUIC_CORE_QUIC_UTILS_H_ |
OLD | NEW |