wub | f975eac | 2019-08-19 19:41:01 -0700 | [diff] [blame] | 1 | // Copyright (c) 2019 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "net/third_party/quiche/src/quic/qbone/qbone_constants.h" |
| 6 | |
| 7 | #include "net/third_party/quiche/src/quic/core/quic_utils.h" |
| 8 | |
| 9 | namespace quic { |
| 10 | |
| 11 | constexpr char QboneConstants::kQboneAlpn[]; |
| 12 | const QuicByteCount QboneConstants::kMaxQbonePacketBytes; |
| 13 | const uint32_t QboneConstants::kQboneRouteTableId; |
| 14 | |
| 15 | QuicStreamId QboneConstants::GetControlStreamId(QuicTransportVersion version) { |
| 16 | return QuicUtils::GetFirstBidirectionalStreamId(version, |
| 17 | Perspective::IS_CLIENT); |
| 18 | } |
| 19 | |
| 20 | const QuicIpAddress* QboneConstants::TerminatorLocalAddress() { |
| 21 | static auto* terminator_address = []() { |
| 22 | QuicIpAddress* address = new QuicIpAddress; |
| 23 | // 0x71 0x62 0x6f 0x6e 0x65 is 'qbone' in ascii. |
| 24 | address->FromString("fe80::71:626f:6e65"); |
| 25 | return address; |
| 26 | }(); |
| 27 | return terminator_address; |
| 28 | } |
| 29 | |
| 30 | const IpRange* QboneConstants::TerminatorLocalAddressRange() { |
| 31 | static auto* range = |
| 32 | new quic::IpRange(*quic::QboneConstants::TerminatorLocalAddress(), 128); |
| 33 | return range; |
| 34 | } |
| 35 | |
| 36 | } // namespace quic |