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 #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_TEST_LOOPBACK_H_ 6 #define QUICHE_COMMON_PLATFORM_API_QUICHE_TEST_LOOPBACK_H_ 7 8 #include "quiche_platform_impl/quiche_test_loopback_impl.h" 9 10 #include "quiche/quic/platform/api/quic_ip_address.h" 11 #include "quiche/quic/platform/api/quic_ip_address_family.h" 12 13 namespace quiche { 14 15 // Returns the address family (IPv4 or IPv6) used to run test under. 16 quic::IpAddressFamily AddressFamilyUnderTest(); 17 18 // Returns an IPv4 loopback address. 19 quic::QuicIpAddress TestLoopback4(); 20 21 // Returns the only IPv6 loopback address. 22 quic::QuicIpAddress TestLoopback6(); 23 24 // Returns an appropriate IPv4/Ipv6 loopback address based upon whether the 25 // test's environment. 26 quic::QuicIpAddress TestLoopback(); 27 28 // If address family under test is IPv4, returns an indexed IPv4 loopback 29 // address. If address family under test is IPv6, the address returned is 30 // platform-dependent. 31 quic::QuicIpAddress TestLoopback(int index); 32 33 } // namespace quiche 34 35 #endif // QUICHE_COMMON_PLATFORM_API_QUICHE_TEST_LOOPBACK_H_ 36