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

Side by Side Diff: chrome/browser/chromeos/cros/network_ip_config.cc

Issue 11756002: Move cros_network_functions.cc to src/chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang fixes Created 7 years, 11 months 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/cros/network_ip_config.h"
6
7 #include "base/logging.h"
8
9 namespace chromeos {
10
11 namespace {
12 #define ENUM_CASE(x) case x: return std::string(#x)
13 std::string IPConfigTypeAsString(IPConfigType type) {
14 switch (type) {
15 ENUM_CASE(IPCONFIG_TYPE_UNKNOWN);
16 ENUM_CASE(IPCONFIG_TYPE_IPV4);
17 ENUM_CASE(IPCONFIG_TYPE_IPV6);
18 ENUM_CASE(IPCONFIG_TYPE_DHCP);
19 ENUM_CASE(IPCONFIG_TYPE_BOOTP);
20 ENUM_CASE(IPCONFIG_TYPE_ZEROCONF);
21 ENUM_CASE(IPCONFIG_TYPE_DHCP6);
22 ENUM_CASE(IPCONFIG_TYPE_PPP);
23 }
24 NOTREACHED() << "Unhandled enum value " << type;
25 return std::string();
26 }
27 #undef ENUM_CASE
28 } // namespace
29
30 NetworkIPConfig::NetworkIPConfig(
31 const std::string& device_path, IPConfigType type,
32 const std::string& address, const std::string& netmask,
33 const std::string& gateway, const std::string& name_servers)
34 : device_path(device_path),
35 type(type),
36 address(address),
37 netmask(netmask),
38 gateway(gateway),
39 name_servers(name_servers) {
40 }
41
42 NetworkIPConfig::~NetworkIPConfig() {}
43
44 std::string NetworkIPConfig::ToString() const {
45 return std::string("path: ") + device_path
46 + " type: " + IPConfigTypeAsString(type)
47 + " address: " + address
48 + " netmask: " + netmask
49 + " gateway: " + gateway
50 + " name_servers: " + name_servers;
51 }
52
53 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/network_ip_config.h ('k') | chrome/browser/chromeos/cros/network_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698