OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 #ifndef COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ | |
6 #define COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ | |
7 | |
8 #include <string> | |
9 | |
10 namespace wifi_sync { | |
11 | |
12 enum WifiSecurityClass { | |
13 SECURITY_CLASS_INVALID, | |
14 SECURITY_CLASS_NONE, | |
15 SECURITY_CLASS_WEP, | |
16 SECURITY_CLASS_PSK, // WPA-PSK or RSN-PSK | |
17 SECURITY_CLASS_802_1X, // WPA-Enterprise or RSN-Enterprise | |
18 }; | |
19 | |
20 #if defined(OS_CHROMEOS) | |
21 // Convert from a SecurityClass string presented by the ChromeOS | |
22 // connection manager ("shill") to a WifiSecurityClass enum. | |
23 // | |
stevenjb
2014/11/04 17:21:21
nit: no separation within function comments
mukesh agrawal
2014/11/04 19:04:06
Done.
| |
24 // Returns the appropriate enum value. If |security_class_in| is | |
25 // unrecognized, returns SECURITY_CLASS_INVALID. | |
26 WifiSecurityClass WifiSecurityClassFromShillString( | |
27 const std::string& security_class_in); | |
28 | |
29 // Convert from a WifiSecurityClass enum to a SecurityClass string | |
30 // suitable for configuring the ChromeOS connection manager | |
31 // ("shill"). The resulting string is written to |security_class_out|. | |
32 // | |
33 // May fail if |security_class_in| is SECURITY_CLASS_INVALID, or | |
34 // outside the range of the WifiSecurityClass enum. Returns true if | |
35 // |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.
| |
36 bool WifiSecurityClassToShillString(WifiSecurityClass security_class_in, | |
37 std::string* security_class_out); | |
38 #endif // OS_CHROMEOS | |
39 | |
40 } // namespace wifi_sync | |
41 | |
42 #endif // COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ | |
OLD | NEW |