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_CORE_QUIC_CONSTANTS_H_ | 5 #ifndef NET_QUIC_CORE_QUIC_CONSTANTS_H_ |
6 #define NET_QUIC_CORE_QUIC_CONSTANTS_H_ | 6 #define NET_QUIC_CORE_QUIC_CONSTANTS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <cstdint> | 10 #include <cstdint> |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // if (exponent == 0) value = mantissa; | 164 // if (exponent == 0) value = mantissa; |
165 // else value = (mantissa | 1 << 11) << (exponent - 1) | 165 // else value = (mantissa | 1 << 11) << (exponent - 1) |
166 const int kUFloat16ExponentBits = 5; | 166 const int kUFloat16ExponentBits = 5; |
167 const int kUFloat16MaxExponent = (1 << kUFloat16ExponentBits) - 2; // 30 | 167 const int kUFloat16MaxExponent = (1 << kUFloat16ExponentBits) - 2; // 30 |
168 const int kUFloat16MantissaBits = 16 - kUFloat16ExponentBits; // 11 | 168 const int kUFloat16MantissaBits = 16 - kUFloat16ExponentBits; // 11 |
169 const int kUFloat16MantissaEffectiveBits = kUFloat16MantissaBits + 1; // 12 | 169 const int kUFloat16MantissaEffectiveBits = kUFloat16MantissaBits + 1; // 12 |
170 const uint64_t kUFloat16MaxValue = // 0x3FFC0000000 | 170 const uint64_t kUFloat16MaxValue = // 0x3FFC0000000 |
171 ((UINT64_C(1) << kUFloat16MantissaEffectiveBits) - 1) | 171 ((UINT64_C(1) << kUFloat16MantissaEffectiveBits) - 1) |
172 << kUFloat16MaxExponent; | 172 << kUFloat16MaxExponent; |
173 | 173 |
174 // Default path ID. | |
175 const QuicPathId kDefaultPathId = 0; | |
176 // Invalid path ID. | |
177 const QuicPathId kInvalidPathId = 0xff; | |
178 | |
179 // kDiversificationNonceSize is the size, in bytes, of the nonce that a server | 174 // kDiversificationNonceSize is the size, in bytes, of the nonce that a server |
180 // may set in the packet header to ensure that its INITIAL keys are not | 175 // may set in the packet header to ensure that its INITIAL keys are not |
181 // duplicated. | 176 // duplicated. |
182 const size_t kDiversificationNonceSize = 32; | 177 const size_t kDiversificationNonceSize = 32; |
183 | 178 |
184 // The largest gap in packets we'll accept without closing the connection. | 179 // The largest gap in packets we'll accept without closing the connection. |
185 // This will likely have to be tuned. | 180 // This will likely have to be tuned. |
186 const QuicPacketNumber kMaxPacketGap = 5000; | 181 const QuicPacketNumber kMaxPacketGap = 5000; |
187 | 182 |
188 } // namespace net | 183 } // namespace net |
189 | 184 |
190 #endif // NET_QUIC_CORE_QUIC_CONSTANTS_H_ | 185 #endif // NET_QUIC_CORE_QUIC_CONSTANTS_H_ |
OLD | NEW |