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

Unified Diff: chromeos/network/network_util.cc

Issue 285233008: Add MacAddress to ONC and networkingPrivate (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Rebase Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/network_util.h ('k') | chromeos/network/onc/onc_signature.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_util.cc
diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc
index 9dedc039f243c4895d4b286fe3c857c42f73c1ab..8408c9a40c3a0d9d38cd9ff414220b1376993435 100644
--- a/chromeos/network/network_util.cc
+++ b/chromeos/network/network_util.cc
@@ -5,6 +5,7 @@
#include "chromeos/network/network_util.h"
#include "base/strings/string_tokenizer.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "chromeos/network/favorite_state.h"
#include "chromeos/network/network_state.h"
@@ -99,6 +100,18 @@ int32 NetmaskToPrefixLength(const std::string& netmask) {
return prefix_length;
}
+std::string FormattedMacAddress(const std::string& shill_mac_address) {
+ if (shill_mac_address.size() % 2 != 0)
+ return shill_mac_address;
+ std::string result;
+ for (size_t i = 0; i < shill_mac_address.size(); ++i) {
+ if ((i != 0) && (i % 2 == 0))
+ result.push_back(':');
+ result.push_back(base::ToUpperASCII(shill_mac_address[i]));
+ }
+ return result;
+}
+
bool ParseCellularScanResults(const base::ListValue& list,
std::vector<CellularScanResult>* scan_results) {
scan_results->clear();
« no previous file with comments | « chromeos/network/network_util.h ('k') | chromeos/network/onc/onc_signature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698