blob: 7d509c6a129ceadefdc6ef4583c21274b28928ab [file] [log] [blame]
henrike@webrtc.orgf0488722014-05-13 18:00:26 +00001/*
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
11#ifndef WEBRTC_BASE_NETWORK_H_
12#define WEBRTC_BASE_NETWORK_H_
13
14#include <deque>
15#include <map>
jbauch555604a2016-04-26 03:13:22 -070016#include <memory>
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000017#include <string>
18#include <vector>
19
20#include "webrtc/base/basictypes.h"
21#include "webrtc/base/ipaddress.h"
honghaiza7ad7c32016-02-02 12:54:14 -080022#include "webrtc/base/networkmonitor.h"
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000023#include "webrtc/base/messagehandler.h"
24#include "webrtc/base/sigslot.h"
25
26#if defined(WEBRTC_POSIX)
27struct ifaddrs;
28#endif // defined(WEBRTC_POSIX)
29
30namespace rtc {
31
Guo-wei Shieh9af97f82015-11-10 14:47:39 -080032extern const char kPublicIPv4Host[];
33extern const char kPublicIPv6Host[];
34
Guo-wei Shieh9faf1542015-12-28 14:06:55 -080035class IfAddrsConverter;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000036class Network;
honghaiz023f3ef2015-10-19 09:39:32 -070037class NetworkMonitorInterface;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000038class Thread;
39
Honghai Zhang351d77b2016-05-20 15:08:29 -070040static const uint16_t kNetworkCostMax = 999;
41static const uint16_t kNetworkCostHigh = 900;
42static const uint16_t kNetworkCostUnknown = 50;
43static const uint16_t kNetworkCostLow = 10;
44static const uint16_t kNetworkCostMin = 0;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000045
phoglund@webrtc.org006521d2015-02-12 09:23:59 +000046// By default, ignore loopback interfaces on the host.
47const int kDefaultNetworkIgnoreMask = ADAPTER_TYPE_LOOPBACK;
48
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000049// Makes a string key for this network. Used in the network manager's maps.
50// Network objects are keyed on interface name, network prefix and the
51// length of that prefix.
52std::string MakeNetworkKey(const std::string& name, const IPAddress& prefix,
53 int prefix_length);
54
Guo-wei Shieh9af97f82015-11-10 14:47:39 -080055class DefaultLocalAddressProvider {
56 public:
57 virtual ~DefaultLocalAddressProvider() = default;
58 // The default local address is the local address used in multi-homed endpoint
Guo-wei Shiehe03cab92015-11-11 11:11:19 -080059 // when the any address (0.0.0.0 or ::) is used as the local address. It's
60 // important to check the return value as a IP family may not be enabled.
Guo-wei Shieh9af97f82015-11-10 14:47:39 -080061 virtual bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const = 0;
62};
63
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000064// Generic network manager interface. It provides list of local
65// networks.
Taylor Brandstetterf8e65772016-06-27 17:20:15 -070066//
67// Every method of NetworkManager (including the destructor) must be called on
68// the same thread, except for the constructor which may be called on any
69// thread.
70//
71// This allows constructing a NetworkManager subclass on one thread and
72// passing it into an object that uses it on a different thread.
Guo-wei Shieh9af97f82015-11-10 14:47:39 -080073class NetworkManager : public DefaultLocalAddressProvider {
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000074 public:
75 typedef std::vector<Network*> NetworkList;
76
Guo-wei Shieh47872ec2015-08-19 10:32:46 -070077 // This enum indicates whether adapter enumeration is allowed.
78 enum EnumerationPermission {
guoweisea1012b2015-08-21 09:06:28 -070079 ENUMERATION_ALLOWED, // Adapter enumeration is allowed. Getting 0 network
80 // from GetNetworks means that there is no network
81 // available.
82 ENUMERATION_BLOCKED, // Adapter enumeration is disabled.
83 // GetAnyAddressNetworks() should be used instead.
Guo-wei Shieh47872ec2015-08-19 10:32:46 -070084 };
85
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000086 NetworkManager();
Guo-wei Shieh9af97f82015-11-10 14:47:39 -080087 ~NetworkManager() override;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000088
89 // Called when network list is updated.
90 sigslot::signal0<> SignalNetworksChanged;
91
92 // Indicates a failure when getting list of network interfaces.
93 sigslot::signal0<> SignalError;
94
Taylor Brandstetterf8e65772016-06-27 17:20:15 -070095 // This should be called on the NetworkManager's thread before the
96 // NetworkManager is used. Subclasses may override this if necessary.
97 virtual void Initialize() {}
98
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000099 // Start/Stop monitoring of network interfaces
phoglund@webrtc.org006521d2015-02-12 09:23:59 +0000100 // list. SignalNetworksChanged or SignalError is emitted immediately
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000101 // after StartUpdating() is called. After that SignalNetworksChanged
phoglund@webrtc.org006521d2015-02-12 09:23:59 +0000102 // is emitted whenever list of networks changes.
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000103 virtual void StartUpdating() = 0;
104 virtual void StopUpdating() = 0;
105
106 // Returns the current list of networks available on this machine.
Guo-wei Shieh47872ec2015-08-19 10:32:46 -0700107 // StartUpdating() must be called before this method is called.
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000108 // It makes sure that repeated calls return the same object for a
109 // given network, so that quality is tracked appropriately. Does not
110 // include ignored networks.
111 virtual void GetNetworks(NetworkList* networks) const = 0;
112
Guo-wei Shieh47872ec2015-08-19 10:32:46 -0700113 // return the current permission state of GetNetworks()
Guo-wei Shieh86cb9232015-08-19 10:57:53 -0700114 virtual EnumerationPermission enumeration_permission() const;
Guo-wei Shieh47872ec2015-08-19 10:32:46 -0700115
guoweis@webrtc.orgf358aea2015-02-18 18:44:01 +0000116 // "AnyAddressNetwork" is a network which only contains single "any address"
117 // IP address. (i.e. INADDR_ANY for IPv4 or in6addr_any for IPv6). This is
118 // useful as binding to such interfaces allow default routing behavior like
119 // http traffic.
guoweis@webrtc.org9dfe7aa2015-02-18 20:27:17 +0000120 // TODO(guoweis): remove this body when chromium implements this.
121 virtual void GetAnyAddressNetworks(NetworkList* networks) {}
guoweis@webrtc.orgf358aea2015-02-18 18:44:01 +0000122
honghaizdb8cf502015-12-21 13:08:46 -0800123 // Dumps the current list of networks in the network manager.
124 virtual void DumpNetworks() {}
Guo-wei Shieh9af97f82015-11-10 14:47:39 -0800125 bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const override;
126
guoweis@webrtc.orga094cac2015-01-28 19:34:05 +0000127 struct Stats {
128 int ipv4_network_count;
129 int ipv6_network_count;
130 Stats() {
131 ipv4_network_count = 0;
132 ipv6_network_count = 0;
133 }
134 };
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000135};
136
137// Base class for NetworkManager implementations.
138class NetworkManagerBase : public NetworkManager {
139 public:
140 NetworkManagerBase();
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +0000141 ~NetworkManagerBase() override;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000142
Honghai Zhang5622c5e2016-07-01 13:59:29 -0700143 void GetNetworks(NetworkList* networks) const override;
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +0000144 void GetAnyAddressNetworks(NetworkList* networks) override;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000145 bool ipv6_enabled() const { return ipv6_enabled_; }
146 void set_ipv6_enabled(bool enabled) { ipv6_enabled_ = enabled; }
147
guoweis@webrtc.org2444d962015-01-30 00:09:28 +0000148 void set_max_ipv6_networks(int networks) { max_ipv6_networks_ = networks; }
149 int max_ipv6_networks() { return max_ipv6_networks_; }
150
Guo-wei Shieh47872ec2015-08-19 10:32:46 -0700151 EnumerationPermission enumeration_permission() const override;
152
Guo-wei Shieh9af97f82015-11-10 14:47:39 -0800153 bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const override;
154
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000155 protected:
156 typedef std::map<std::string, Network*> NetworkMap;
157 // Updates |networks_| with the networks listed in |list|. If
158 // |network_map_| already has a Network object for a network listed
159 // in the |list| then it is reused. Accept ownership of the Network
160 // objects in the |list|. |changed| will be set to true if there is
161 // any change in the network list.
162 void MergeNetworkList(const NetworkList& list, bool* changed);
163
guoweis@webrtc.orga094cac2015-01-28 19:34:05 +0000164 // |stats| will be populated even if |*changed| is false.
165 void MergeNetworkList(const NetworkList& list,
166 bool* changed,
167 NetworkManager::Stats* stats);
168
Guo-wei Shieh47872ec2015-08-19 10:32:46 -0700169 void set_enumeration_permission(EnumerationPermission state) {
170 enumeration_permission_ = state;
171 }
172
Guo-wei Shieh9af97f82015-11-10 14:47:39 -0800173 void set_default_local_addresses(const IPAddress& ipv4,
174 const IPAddress& ipv6);
175
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000176 private:
177 friend class NetworkTest;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000178
honghaizaf83fe62016-04-18 14:50:44 -0700179 Network* GetNetworkFromAddress(const rtc::IPAddress& ip) const;
180
Guo-wei Shieh47872ec2015-08-19 10:32:46 -0700181 EnumerationPermission enumeration_permission_;
182
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000183 NetworkList networks_;
guoweis@webrtc.org2444d962015-01-30 00:09:28 +0000184 int max_ipv6_networks_;
185
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000186 NetworkMap networks_map_;
187 bool ipv6_enabled_;
guoweis@webrtc.orgf358aea2015-02-18 18:44:01 +0000188
jbauch555604a2016-04-26 03:13:22 -0700189 std::unique_ptr<rtc::Network> ipv4_any_address_network_;
190 std::unique_ptr<rtc::Network> ipv6_any_address_network_;
Guo-wei Shieh9af97f82015-11-10 14:47:39 -0800191
192 IPAddress default_local_ipv4_address_;
193 IPAddress default_local_ipv6_address_;
honghaiza0c44ea2016-03-23 16:07:48 -0700194 // We use 16 bits to save the bandwidth consumption when sending the network
195 // id over the Internet. It is OK that the 16-bit integer overflows to get a
196 // network id 0 because we only compare the network ids in the old and the new
197 // best connections in the transport channel.
198 uint16_t next_available_network_id_ = 1;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000199};
200
201// Basic implementation of the NetworkManager interface that gets list
202// of networks using OS APIs.
203class BasicNetworkManager : public NetworkManagerBase,
honghaiz023f3ef2015-10-19 09:39:32 -0700204 public MessageHandler,
205 public sigslot::has_slots<> {
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000206 public:
207 BasicNetworkManager();
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +0000208 ~BasicNetworkManager() override;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000209
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +0000210 void StartUpdating() override;
211 void StopUpdating() override;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000212
honghaizdb8cf502015-12-21 13:08:46 -0800213 void DumpNetworks() override;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000214
215 // MessageHandler interface.
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +0000216 void OnMessage(Message* msg) override;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000217 bool started() { return start_count_ > 0; }
218
phoglund@webrtc.org006521d2015-02-12 09:23:59 +0000219 // Sets the network ignore list, which is empty by default. Any network on the
220 // ignore list will be filtered from network enumeration results.
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000221 void set_network_ignore_list(const std::vector<std::string>& list) {
222 network_ignore_list_ = list;
223 }
phoglund@webrtc.org006521d2015-02-12 09:23:59 +0000224
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000225#if defined(WEBRTC_LINUX)
226 // Sets the flag for ignoring non-default routes.
227 void set_ignore_non_default_routes(bool value) {
228 ignore_non_default_routes_ = true;
229 }
230#endif
231
232 protected:
233#if defined(WEBRTC_POSIX)
234 // Separated from CreateNetworks for tests.
235 void ConvertIfAddrs(ifaddrs* interfaces,
Guo-wei Shieh9faf1542015-12-28 14:06:55 -0800236 IfAddrsConverter* converter,
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000237 bool include_ignored,
238 NetworkList* networks) const;
239#endif // defined(WEBRTC_POSIX)
240
241 // Creates a network object for each network available on the machine.
242 bool CreateNetworks(bool include_ignored, NetworkList* networks) const;
243
guoweis@webrtc.orgb91d0f52015-03-17 14:43:20 +0000244 // Determines if a network should be ignored. This should only be determined
245 // based on the network's property instead of any individual IP.
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000246 bool IsIgnoredNetwork(const Network& network) const;
247
Guo-wei Shieh9af97f82015-11-10 14:47:39 -0800248 // This function connects a UDP socket to a public address and returns the
249 // local address associated it. Since it binds to the "any" address
250 // internally, it returns the default local address on a multi-homed endpoint.
251 IPAddress QueryDefaultLocalAddress(int family) const;
252
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000253 private:
254 friend class NetworkTest;
255
honghaiz023f3ef2015-10-19 09:39:32 -0700256 // Creates a network monitor and listens for network updates.
257 void StartNetworkMonitor();
258 // Stops and removes the network monitor.
259 void StopNetworkMonitor();
260 // Called when it receives updates from the network monitor.
261 void OnNetworksChanged();
262
263 // Updates the networks and reschedules the next update.
264 void UpdateNetworksContinually();
265 // Only updates the networks; does not reschedule the next update.
266 void UpdateNetworksOnce();
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000267
Honghai Zhang351d77b2016-05-20 15:08:29 -0700268 AdapterType GetAdapterTypeFromName(const char* network_name) const;
269
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000270 Thread* thread_;
271 bool sent_first_update_;
272 int start_count_;
273 std::vector<std::string> network_ignore_list_;
274 bool ignore_non_default_routes_;
jbauch555604a2016-04-26 03:13:22 -0700275 std::unique_ptr<NetworkMonitorInterface> network_monitor_;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000276};
277
278// Represents a Unix-type network interface, with a name and single address.
279class Network {
280 public:
Guo-wei Shieh9af97f82015-11-10 14:47:39 -0800281 Network(const std::string& name,
282 const std::string& description,
283 const IPAddress& prefix,
284 int prefix_length);
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000285
Guo-wei Shieh9af97f82015-11-10 14:47:39 -0800286 Network(const std::string& name,
287 const std::string& description,
288 const IPAddress& prefix,
289 int prefix_length,
290 AdapterType type);
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +0000291 ~Network();
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000292
Honghai Zhang351d77b2016-05-20 15:08:29 -0700293 sigslot::signal1<const Network*> SignalTypeChanged;
honghaize3c6c822016-02-17 13:00:28 -0800294
Guo-wei Shieh9af97f82015-11-10 14:47:39 -0800295 const DefaultLocalAddressProvider* default_local_address_provider() {
296 return default_local_address_provider_;
297 }
298 void set_default_local_address_provider(
299 const DefaultLocalAddressProvider* provider) {
300 default_local_address_provider_ = provider;
301 }
302
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000303 // Returns the name of the interface this network is associated wtih.
304 const std::string& name() const { return name_; }
305
306 // Returns the OS-assigned name for this network. This is useful for
307 // debugging but should not be sent over the wire (for privacy reasons).
308 const std::string& description() const { return description_; }
309
310 // Returns the prefix for this network.
311 const IPAddress& prefix() const { return prefix_; }
312 // Returns the length, in bits, of this network's prefix.
313 int prefix_length() const { return prefix_length_; }
314
315 // |key_| has unique value per network interface. Used in sorting network
316 // interfaces. Key is derived from interface name and it's prefix.
317 std::string key() const { return key_; }
318
aluebs@webrtc.org07dcf602015-02-27 18:42:22 +0000319 // Returns the Network's current idea of the 'best' IP it has.
320 // Or return an unset IP if this network has no active addresses.
321 // Here is the rule on how we mark the IPv6 address as ignorable for WebRTC.
322 // 1) return all global temporary dynamic and non-deprecrated ones.
323 // 2) if #1 not available, return global ones.
324 // 3) if #2 not available, use ULA ipv6 as last resort. (ULA stands
325 // for unique local address, which is not route-able in open
326 // internet but might be useful for a close WebRTC deployment.
327
328 // TODO(guoweis): rule #3 actually won't happen at current
329 // implementation. The reason being that ULA address starting with
330 // 0xfc 0r 0xfd will be grouped into its own Network. The result of
331 // that is WebRTC will have one extra Network to generate candidates
332 // but the lack of rule #3 shouldn't prevent turning on IPv6 since
333 // ULA should only be tried in a close deployment anyway.
334
335 // Note that when not specifying any flag, it's treated as case global
336 // IPv6 address
guoweis@webrtc.org369a6372014-09-17 22:37:29 +0000337 IPAddress GetBestIP() const;
338
339 // Keep the original function here for now.
340 // TODO(guoweis): Remove this when all callers are migrated to GetBestIP().
341 IPAddress ip() const { return GetBestIP(); }
guoweis@webrtc.orgfa603982014-09-09 23:42:40 +0000342
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000343 // Adds an active IP address to this network. Does not check for duplicates.
guoweis@webrtc.orgfa603982014-09-09 23:42:40 +0000344 void AddIP(const InterfaceAddress& ip) { ips_.push_back(ip); }
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000345
346 // Sets the network's IP address list. Returns true if new IP addresses were
347 // detected. Passing true to already_changed skips this check.
guoweis@webrtc.orgfa603982014-09-09 23:42:40 +0000348 bool SetIPs(const std::vector<InterfaceAddress>& ips, bool already_changed);
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000349 // Get the list of IP Addresses associated with this network.
guoweis@webrtc.orgfa603982014-09-09 23:42:40 +0000350 const std::vector<InterfaceAddress>& GetIPs() const { return ips_;}
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000351 // Clear the network's list of addresses.
352 void ClearIPs() { ips_.clear(); }
353
354 // Returns the scope-id of the network's address.
355 // Should only be relevant for link-local IPv6 addresses.
356 int scope_id() const { return scope_id_; }
357 void set_scope_id(int id) { scope_id_ = id; }
358
359 // Indicates whether this network should be ignored, perhaps because
360 // the IP is 0, or the interface is one we know is invalid.
361 bool ignored() const { return ignored_; }
362 void set_ignored(bool ignored) { ignored_ = ignored; }
363
364 AdapterType type() const { return type_; }
Honghai Zhang351d77b2016-05-20 15:08:29 -0700365 void set_type(AdapterType type) {
366 if (type_ == type) {
367 return;
368 }
369 type_ = type;
370 SignalTypeChanged(this);
371 }
honghaize2af9ef2016-03-03 08:27:47 -0800372
Honghai Zhang351d77b2016-05-20 15:08:29 -0700373 uint16_t GetCost() const {
374 switch (type_) {
375 case rtc::ADAPTER_TYPE_ETHERNET:
376 case rtc::ADAPTER_TYPE_LOOPBACK:
377 return kNetworkCostMin;
378 case rtc::ADAPTER_TYPE_WIFI:
379 case rtc::ADAPTER_TYPE_VPN:
380 return kNetworkCostLow;
381 case rtc::ADAPTER_TYPE_CELLULAR:
382 return kNetworkCostHigh;
383 default:
384 return kNetworkCostUnknown;
385 }
386 }
honghaiza0c44ea2016-03-23 16:07:48 -0700387 // A unique id assigned by the network manager, which may be signaled
388 // to the remote side in the candidate.
389 uint16_t id() const { return id_; }
390 void set_id(uint16_t id) { id_ = id; }
391
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000392 int preference() const { return preference_; }
393 void set_preference(int preference) { preference_ = preference; }
394
honghaizdb8cf502015-12-21 13:08:46 -0800395 // When we enumerate networks and find a previously-seen network is missing,
396 // we do not remove it (because it may be used elsewhere). Instead, we mark
397 // it inactive, so that we can detect network changes properly.
398 bool active() const { return active_; }
honghaize3c6c822016-02-17 13:00:28 -0800399 void set_active(bool active) {
Honghai Zhang5622c5e2016-07-01 13:59:29 -0700400 if (active_ != active) {
401 active_ = active;
honghaize3c6c822016-02-17 13:00:28 -0800402 }
403 }
honghaizdb8cf502015-12-21 13:08:46 -0800404
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000405 // Debugging description of this network
406 std::string ToString() const;
407
408 private:
Guo-wei Shieh9af97f82015-11-10 14:47:39 -0800409 const DefaultLocalAddressProvider* default_local_address_provider_ = nullptr;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000410 std::string name_;
411 std::string description_;
412 IPAddress prefix_;
413 int prefix_length_;
414 std::string key_;
guoweis@webrtc.orgfa603982014-09-09 23:42:40 +0000415 std::vector<InterfaceAddress> ips_;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000416 int scope_id_;
417 bool ignored_;
418 AdapterType type_;
419 int preference_;
honghaizdb8cf502015-12-21 13:08:46 -0800420 bool active_ = true;
honghaiza0c44ea2016-03-23 16:07:48 -0700421 uint16_t id_ = 0;
henrike@webrtc.orgf0488722014-05-13 18:00:26 +0000422
423 friend class NetworkManager;
424};
425
426} // namespace rtc
427
428#endif // WEBRTC_BASE_NETWORK_H_