OLD | NEW |
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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 if (ipv4.family() == AF_INET) { | 338 if (ipv4.family() == AF_INET) { |
339 default_local_ipv4_address_ = ipv4; | 339 default_local_ipv4_address_ = ipv4; |
340 } | 340 } |
341 if (ipv6.family() == AF_INET6) { | 341 if (ipv6.family() == AF_INET6) { |
342 default_local_ipv6_address_ = ipv6; | 342 default_local_ipv6_address_ = ipv6; |
343 } | 343 } |
344 } | 344 } |
345 | 345 |
346 bool NetworkManagerBase::GetDefaultLocalAddress(int family, | 346 bool NetworkManagerBase::GetDefaultLocalAddress(int family, |
347 IPAddress* ipaddr) const { | 347 IPAddress* ipaddr) const { |
348 if (family == AF_INET && !default_local_ipv4_address_.IsNil()) { | 348 if (family == AF_INET) { |
349 *ipaddr = default_local_ipv4_address_; | 349 *ipaddr = default_local_ipv4_address_; |
350 return true; | 350 return true; |
351 } else if (family == AF_INET6 && !default_local_ipv6_address_.IsNil()) { | 351 } else if (family == AF_INET6) { |
352 *ipaddr = default_local_ipv6_address_; | 352 *ipaddr = default_local_ipv6_address_; |
353 return true; | 353 return true; |
354 } | 354 } |
355 return false; | 355 return false; |
356 } | 356 } |
357 | 357 |
358 BasicNetworkManager::BasicNetworkManager() | 358 BasicNetworkManager::BasicNetworkManager() |
359 : thread_(NULL), sent_first_update_(false), start_count_(0), | 359 : thread_(NULL), sent_first_update_(false), start_count_(0), |
360 network_ignore_mask_(kDefaultNetworkIgnoreMask), | 360 network_ignore_mask_(kDefaultNetworkIgnoreMask), |
361 ignore_non_default_routes_(false) { | 361 ignore_non_default_routes_(false) { |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 std::stringstream ss; | 911 std::stringstream ss; |
912 // Print out the first space-terminated token of the network desc, plus | 912 // Print out the first space-terminated token of the network desc, plus |
913 // the IP address. | 913 // the IP address. |
914 ss << "Net[" << description_.substr(0, description_.find(' ')) | 914 ss << "Net[" << description_.substr(0, description_.find(' ')) |
915 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ | 915 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ |
916 << ":" << AdapterTypeToString(type_) << "]"; | 916 << ":" << AdapterTypeToString(type_) << "]"; |
917 return ss.str(); | 917 return ss.str(); |
918 } | 918 } |
919 | 919 |
920 } // namespace rtc | 920 } // namespace rtc |
OLD | NEW |