1 // Copyright (c) 2017 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 "quiche_platform_impl/quiche_test_loopback_impl.h" 6 7 namespace quiche { 8 AddressFamilyUnderTestImpl()9quic::IpAddressFamily AddressFamilyUnderTestImpl() { 10 return quic::IpAddressFamily::IP_V4; 11 } 12 TestLoopback4Impl()13quic::QuicIpAddress TestLoopback4Impl() { 14 return quic::QuicIpAddress::Loopback4(); 15 } 16 TestLoopback6Impl()17quic::QuicIpAddress TestLoopback6Impl() { 18 return quic::QuicIpAddress::Loopback6(); 19 } 20 TestLoopbackImpl()21quic::QuicIpAddress TestLoopbackImpl() { 22 return quic::QuicIpAddress::Loopback4(); 23 } 24 TestLoopbackImpl(int index)25quic::QuicIpAddress TestLoopbackImpl(int index) { 26 const char kLocalhostIPv4[] = {127, 0, 0, static_cast<char>(index)}; 27 quic::QuicIpAddress address; 28 address.FromPackedString(kLocalhostIPv4, 4); 29 return address; 30 } 31 32 } // namespace quiche 33