network_util.h 987 B

12345678910111213141516171819202122232425262728
  1. // Copyright 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. #ifndef COMPONENTS_OPENSCREEN_PLATFORM_NETWORK_UTIL_H_
  5. #define COMPONENTS_OPENSCREEN_PLATFORM_NETWORK_UTIL_H_
  6. #include "net/base/address_family.h"
  7. #include "third_party/openscreen/src/platform/base/ip_address.h"
  8. namespace net {
  9. class IPAddress;
  10. class IPEndPoint;
  11. } // namespace net
  12. // Helper methods that convert between Open Screen and Chromium //net types.
  13. namespace openscreen_platform {
  14. const net::IPAddress ToNetAddress(const openscreen::IPAddress& address);
  15. const net::IPEndPoint ToNetEndPoint(const openscreen::IPEndpoint& endpoint);
  16. openscreen::IPAddress::Version ToOpenScreenVersion(
  17. const net::AddressFamily family);
  18. const openscreen::IPEndpoint ToOpenScreenEndPoint(
  19. const net::IPEndPoint& endpoint);
  20. } // namespace openscreen_platform
  21. #endif // COMPONENTS_OPENSCREEN_PLATFORM_NETWORK_UTIL_H_