Jonas Oreland | 71fda36 | 2020-03-20 16:11:56 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 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 | |
| 11 | #include "rtc_base/network_constants.h" |
| 12 | |
| 13 | #include "rtc_base/checks.h" |
| 14 | |
| 15 | namespace rtc { |
| 16 | |
| 17 | std::string AdapterTypeToString(AdapterType type) { |
| 18 | switch (type) { |
| 19 | case ADAPTER_TYPE_ANY: |
| 20 | return "Wildcard"; |
| 21 | case ADAPTER_TYPE_UNKNOWN: |
| 22 | return "Unknown"; |
| 23 | case ADAPTER_TYPE_ETHERNET: |
| 24 | return "Ethernet"; |
| 25 | case ADAPTER_TYPE_WIFI: |
| 26 | return "Wifi"; |
| 27 | case ADAPTER_TYPE_CELLULAR: |
| 28 | return "Cellular"; |
Jonas Oreland | 08d1806 | 2020-04-02 07:19:12 +0200 | [diff] [blame] | 29 | case ADAPTER_TYPE_CELLULAR_2G: |
| 30 | return "Cellular2G"; |
| 31 | case ADAPTER_TYPE_CELLULAR_3G: |
| 32 | return "Cellular3G"; |
| 33 | case ADAPTER_TYPE_CELLULAR_4G: |
| 34 | return "Cellular4G"; |
| 35 | case ADAPTER_TYPE_CELLULAR_5G: |
| 36 | return "Cellular5G"; |
Jonas Oreland | 71fda36 | 2020-03-20 16:11:56 +0100 | [diff] [blame] | 37 | case ADAPTER_TYPE_VPN: |
| 38 | return "VPN"; |
| 39 | case ADAPTER_TYPE_LOOPBACK: |
| 40 | return "Loopback"; |
| 41 | default: |
| 42 | RTC_NOTREACHED() << "Invalid type " << type; |
| 43 | return std::string(); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | } // namespace rtc |