Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: webrtc/base/network.h

Issue 1437933002: Fix a bug when we can't get default address (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: fix comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/p2p/base/stunport.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // Makes a string key for this network. Used in the network manager's maps. 51 // Makes a string key for this network. Used in the network manager's maps.
52 // Network objects are keyed on interface name, network prefix and the 52 // Network objects are keyed on interface name, network prefix and the
53 // length of that prefix. 53 // length of that prefix.
54 std::string MakeNetworkKey(const std::string& name, const IPAddress& prefix, 54 std::string MakeNetworkKey(const std::string& name, const IPAddress& prefix,
55 int prefix_length); 55 int prefix_length);
56 56
57 class DefaultLocalAddressProvider { 57 class DefaultLocalAddressProvider {
58 public: 58 public:
59 virtual ~DefaultLocalAddressProvider() = default; 59 virtual ~DefaultLocalAddressProvider() = default;
60 // The default local address is the local address used in multi-homed endpoint 60 // The default local address is the local address used in multi-homed endpoint
61 // when the any address (0.0.0.0 or ::) is used as the local address. 61 // when the any address (0.0.0.0 or ::) is used as the local address. It's
62 // important to check the return value as a IP family may not be enabled.
62 virtual bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const = 0; 63 virtual bool GetDefaultLocalAddress(int family, IPAddress* ipaddr) const = 0;
63 }; 64 };
64 65
65 // Generic network manager interface. It provides list of local 66 // Generic network manager interface. It provides list of local
66 // networks. 67 // networks.
67 class NetworkManager : public DefaultLocalAddressProvider { 68 class NetworkManager : public DefaultLocalAddressProvider {
68 public: 69 public:
69 typedef std::vector<Network*> NetworkList; 70 typedef std::vector<Network*> NetworkList;
70 71
71 // This enum indicates whether adapter enumeration is allowed. 72 // This enum indicates whether adapter enumeration is allowed.
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 bool ignored_; 374 bool ignored_;
374 AdapterType type_; 375 AdapterType type_;
375 int preference_; 376 int preference_;
376 377
377 friend class NetworkManager; 378 friend class NetworkManager;
378 }; 379 };
379 380
380 } // namespace rtc 381 } // namespace rtc
381 382
382 #endif // WEBRTC_BASE_NETWORK_H_ 383 #endif // WEBRTC_BASE_NETWORK_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/p2p/base/stunport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698