Extend rtc::AdapterType with 2g, 3G, 4G & 5G enum values.

This patch adds new enum values for different types of cellular
connections.

The new costs are currently blocked when sending to remote,
(so that arbitrary network switches does not starts occurring).

The end-game for this series to be able to distinguish between
different type of cellular connections in the ice-layer (e.g when
selecting/switching connections).

BUG: webrtc:11473
Change-Id: I587ac8fdff4f6cdd0f8905f327232f58818db4f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172582
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30970}
This commit is contained in:
Jonas Oreland
2020-04-02 07:19:12 +02:00
committed by Commit Bot
parent 01c107e37a
commit 08d1806e54
8 changed files with 79 additions and 19 deletions

View File

@ -409,6 +409,19 @@ class RTC_EXPORT Network {
bool IsVpn() const { return type_ == ADAPTER_TYPE_VPN; }
bool IsCellular() const {
switch (type_) {
case ADAPTER_TYPE_CELLULAR:
case ADAPTER_TYPE_CELLULAR_2G:
case ADAPTER_TYPE_CELLULAR_3G:
case ADAPTER_TYPE_CELLULAR_4G:
case ADAPTER_TYPE_CELLULAR_5G:
return true;
default:
return false;
}
}
uint16_t GetCost() const;
// A unique id assigned by the network manager, which may be signaled
// to the remote side in the candidate.