OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/cros/network_library_impl_stub.h" | 5 #include "chrome/browser/chromeos/cros/network_library_impl_stub.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 | 9 |
10 using content::BrowserThread; | 10 using content::BrowserThread; |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 } | 668 } |
669 | 669 |
670 NetworkIPConfigVector NetworkLibraryImplStub::GetIPConfigs( | 670 NetworkIPConfigVector NetworkLibraryImplStub::GetIPConfigs( |
671 const std::string& device_path, | 671 const std::string& device_path, |
672 std::string* hardware_address, | 672 std::string* hardware_address, |
673 HardwareAddressFormat format) { | 673 HardwareAddressFormat format) { |
674 *hardware_address = hardware_address_; | 674 *hardware_address = hardware_address_; |
675 return ip_configs_; | 675 return ip_configs_; |
676 } | 676 } |
677 | 677 |
678 void NetworkLibraryImplStub::SetIPConfig(const NetworkIPConfig& ipconfig) { | 678 void NetworkLibraryImplStub::SetIPParameters(const std::string& service_path, |
679 ip_configs_.push_back(ipconfig); | 679 const std::string& address, |
| 680 const std::string& netmask, |
| 681 const std::string& gateway, |
| 682 const std::string& name_servers, |
| 683 int dhcp_usage_mask) { |
| 684 VLOG(1) << "Setting IP parameters:" |
| 685 << "\n address: " << address |
| 686 << (dhcp_usage_mask & USE_DHCP_ADDRESS ? |
| 687 " (ignored)" : " (in use)") |
| 688 << "\n netmask: " << netmask |
| 689 << (dhcp_usage_mask & USE_DHCP_NETMASK ? |
| 690 " (ignored)" : " (in use)") |
| 691 << "\n gateway: " << gateway |
| 692 << (dhcp_usage_mask & USE_DHCP_GATEWAY ? |
| 693 " (ignored)" : " (in use)") |
| 694 << "\n name_servers: " << name_servers |
| 695 << (dhcp_usage_mask & USE_DHCP_NAME_SERVERS ? |
| 696 " (ignored)" : " (in use)"); |
| 697 |
| 698 Network* network = FindNetworkByPath(service_path); |
| 699 if (network) |
| 700 ip_configs_.push_back(NetworkIPConfig(network->device_path(), |
| 701 IPCONFIG_TYPE_IPV4, |
| 702 address, |
| 703 netmask, |
| 704 gateway, |
| 705 name_servers)); |
680 } | 706 } |
681 | 707 |
682 } // namespace chromeos | 708 } // namespace chromeos |
OLD | NEW |