Index: components/wifi_sync/wifi_security_class.h |
diff --git a/components/wifi_sync/wifi_security_class.h b/components/wifi_sync/wifi_security_class.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e35fca8f4a805d5de37349e47024df9407f5d898 |
--- /dev/null |
+++ b/components/wifi_sync/wifi_security_class.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ |
+#define COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ |
+ |
+#include <string> |
+ |
+namespace wifi_sync { |
+ |
+enum WifiSecurityClass { |
+ SECURITY_CLASS_INVALID, |
+ SECURITY_CLASS_NONE, |
+ SECURITY_CLASS_WEP, |
+ SECURITY_CLASS_PSK, // WPA-PSK or RSN-PSK |
+ SECURITY_CLASS_802_1X, // WPA-Enterprise or RSN-Enterprise |
+}; |
+ |
+#if defined(OS_CHROMEOS) |
+// Convert from a SecurityClass string presented by the ChromeOS |
+// connection manager ("shill") to a WifiSecurityClass enum. |
+// |
stevenjb
2014/11/04 17:21:21
nit: no separation within function comments
mukesh agrawal
2014/11/04 19:04:06
Done.
|
+// Returns the appropriate enum value. If |security_class_in| is |
+// unrecognized, returns SECURITY_CLASS_INVALID. |
+WifiSecurityClass WifiSecurityClassFromShillString( |
+ const std::string& security_class_in); |
+ |
+// Convert from a WifiSecurityClass enum to a SecurityClass string |
+// suitable for configuring the ChromeOS connection manager |
+// ("shill"). The resulting string is written to |security_class_out|. |
+// |
+// May fail if |security_class_in| is SECURITY_CLASS_INVALID, or |
+// outside the range of the WifiSecurityClass enum. Returns true if |
+// |security_class_in| was recognized and valid. |
stevenjb
2014/11/04 17:21:21
This can be simplified to "Returns false if |secur
mukesh agrawal
2014/11/04 19:04:06
Done.
|
+bool WifiSecurityClassToShillString(WifiSecurityClass security_class_in, |
+ std::string* security_class_out); |
+#endif // OS_CHROMEOS |
+ |
+} // namespace wifi_sync |
+ |
+#endif // COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ |