| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ | 5 #ifndef COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ |
| 6 #define COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ | 6 #define COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "sync/protocol/sync.pb.h" | 10 #include "sync/protocol/sync.pb.h" |
| 11 | 11 |
| 12 namespace wifi_sync { | 12 namespace wifi_sync { |
| 13 | 13 |
| 14 enum WifiSecurityClass { | 14 enum WifiSecurityClass { |
| 15 SECURITY_CLASS_INVALID, | 15 SECURITY_CLASS_INVALID, |
| 16 SECURITY_CLASS_NONE, | 16 SECURITY_CLASS_NONE, |
| 17 SECURITY_CLASS_WEP, | 17 SECURITY_CLASS_WEP, |
| 18 SECURITY_CLASS_PSK, // WPA-PSK or RSN-PSK | 18 SECURITY_CLASS_PSK, // WPA-PSK or RSN-PSK |
| 19 SECURITY_CLASS_802_1X, // WPA-Enterprise or RSN-Enterprise | 19 SECURITY_CLASS_802_1X, // WPA-Enterprise or RSN-Enterprise |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 // Returns true iff |security_class| allows passphrases. Note that a | 22 // Returns true iff |security_class| allows passphrases. Note that a |
| 23 // security class may permit passphrases, without requiring them. | 23 // security class may permit passphrases, without requiring them. |
| 24 bool WifiSecurityClassSupportsPassphrases(WifiSecurityClass security_class); | 24 bool WifiSecurityClassSupportsPassphrases(WifiSecurityClass security_class); |
| 25 | 25 |
| 26 // Returns true iff |security_class| requires a passphrase to connect. |
| 27 bool WifiSecurityClassRequiresPassphrase(WifiSecurityClass security_class); |
| 28 |
| 29 // Returns true iff networks of |security_class| can be stored in Chrome Sync. |
| 30 bool WifiSecurityClassIsSyncable(WifiSecurityClass security_class); |
| 31 |
| 26 // Converts from Chrome Sync's serialized form of a security class, to | 32 // Converts from Chrome Sync's serialized form of a security class, to |
| 27 // a WifiSecurityClass. Returns the appropriate WifiSecurityClass | 33 // a WifiSecurityClass. Returns the appropriate WifiSecurityClass |
| 28 // value. If |sync_enum| is unrecognized, returns SECURITY_CLASS_INVALID. | 34 // value. If |sync_enum| is unrecognized, returns SECURITY_CLASS_INVALID. |
| 29 WifiSecurityClass | 35 WifiSecurityClass |
| 30 WifiSecurityClassFromSyncSecurityClass( | 36 WifiSecurityClassFromSyncSecurityClass( |
| 31 sync_pb::WifiCredentialSpecifics_SecurityClass sync_enum); | 37 sync_pb::WifiCredentialSpecifics_SecurityClass sync_enum); |
| 32 | 38 |
| 33 // Converts from a WifiSecurityClass enum to Chrome Sync's serialized | 39 // Converts from a WifiSecurityClass enum to Chrome Sync's serialized |
| 34 // form of a security class. Returns the appropriate sync value. If | 40 // form of a security class. Returns the appropriate sync value. If |
| 35 // |security_class| is unrecognized, or unsupported by Chrome Sync, | 41 // |security_class| is unrecognized, or unsupported by Chrome Sync, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 49 // connection manager ("Shill") to a WifiSecurityClass enum. Returns | 55 // connection manager ("Shill") to a WifiSecurityClass enum. Returns |
| 50 // the appropriate enum value. If |shill_security| is unrecognized, | 56 // the appropriate enum value. If |shill_security| is unrecognized, |
| 51 // returns SECURITY_CLASS_INVALID. | 57 // returns SECURITY_CLASS_INVALID. |
| 52 WifiSecurityClass WifiSecurityClassFromShillSecurity( | 58 WifiSecurityClass WifiSecurityClassFromShillSecurity( |
| 53 const std::string& shill_security); | 59 const std::string& shill_security); |
| 54 #endif // OS_CHROMEOS | 60 #endif // OS_CHROMEOS |
| 55 | 61 |
| 56 } // namespace wifi_sync | 62 } // namespace wifi_sync |
| 57 | 63 |
| 58 #endif // COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ | 64 #endif // COMPONENTS_WIFI_SYNC_WIFI_SECURITY_CLASS_H_ |
| OLD | NEW |