You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.4 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Copyright 2004 The WebRTC Project Authors. All rights reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef RTC_BASE_NETWORK_CONSTANTS_H_
  11. #define RTC_BASE_NETWORK_CONSTANTS_H_
  12. #include <stdint.h>
  13. namespace rtc {
  14. static const uint16_t kNetworkCostMax = 999;
  15. static const uint16_t kNetworkCostHigh = 900;
  16. static const uint16_t kNetworkCostUnknown = 50;
  17. static const uint16_t kNetworkCostLow = 10;
  18. static const uint16_t kNetworkCostMin = 0;
  19. enum AdapterType {
  20. // This enum resembles the one in Chromium net::ConnectionType.
  21. ADAPTER_TYPE_UNKNOWN = 0,
  22. ADAPTER_TYPE_ETHERNET = 1 << 0,
  23. ADAPTER_TYPE_WIFI = 1 << 1,
  24. ADAPTER_TYPE_CELLULAR = 1 << 2,
  25. ADAPTER_TYPE_VPN = 1 << 3,
  26. ADAPTER_TYPE_LOOPBACK = 1 << 4,
  27. // ADAPTER_TYPE_ANY is used for a network, which only contains a single "any
  28. // address" IP address (INADDR_ANY for IPv4 or in6addr_any for IPv6), and can
  29. // use any/all network interfaces. Whereas ADAPTER_TYPE_UNKNOWN is used
  30. // when the network uses a specific interface/IP, but its interface type can
  31. // not be determined or not fit in this enum.
  32. ADAPTER_TYPE_ANY = 1 << 5,
  33. };
  34. } // namespace rtc
  35. #endif // RTC_BASE_NETWORK_CONSTANTS_H_