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

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
Index: chromeos/network/network_util.cc
diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc
index 35980b22c6c50736bd0e36d04e97f0f408c6f1f7..ac102ecaa0e92917baaf0383a2894932204e0eac 100644
--- a/chromeos/network/network_util.cc
+++ b/chromeos/network/network_util.cc
@@ -99,6 +99,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(shill_mac_address[i]);
+ }
+ return result;
+}
+
bool ParseCellularScanResults(const base::ListValue& list,
std::vector<CellularScanResult>* scan_results) {
scan_results->clear();

Powered by Google App Engine
This is Rietveld 408576698