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 AdapterTypeToString(AdapterType type)17std::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"; 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"; 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 48