OLD | NEW |
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 CHROMEOS_NETWORK_DEPRECATED_H_ | 5 #ifndef CHROMEOS_NETWORK_DEPRECATED_H_ |
6 #define CHROMEOS_NETWORK_DEPRECATED_H_ | 6 #define CHROMEOS_NETWORK_DEPRECATED_H_ |
7 | 7 |
8 #include <base/basictypes.h> | 8 #include <base/basictypes.h> |
9 #include <base/logging.h> | 9 #include <base/logging.h> |
10 | 10 |
11 namespace chromeos { // NOLINT | 11 namespace chromeos { // NOLINT |
12 | 12 |
| 13 // Connection enums (see flimflam/include/service.h) |
| 14 enum ConnectionType { |
| 15 TYPE_UNKNOWN = 0, |
| 16 TYPE_ETHERNET = 1, |
| 17 TYPE_WIFI = 2, |
| 18 TYPE_WIMAX = 3, |
| 19 TYPE_BLUETOOTH = 4, |
| 20 TYPE_CELLULAR = 5, |
| 21 }; |
| 22 |
| 23 enum ConnectionMode { |
| 24 MODE_UNKNOWN = 0, |
| 25 MODE_MANAGED = 1, |
| 26 MODE_ADHOC = 2, |
| 27 }; |
| 28 |
| 29 enum ConnectionSecurity { |
| 30 SECURITY_UNKNOWN = 0, |
| 31 SECURITY_NONE = 1, |
| 32 SECURITY_WEP = 2, |
| 33 SECURITY_WPA = 3, |
| 34 SECURITY_RSN = 4, |
| 35 SECURITY_8021X = 5, |
| 36 }; |
| 37 |
| 38 enum ConnectionState { |
| 39 STATE_UNKNOWN = 0, |
| 40 STATE_IDLE = 1, |
| 41 STATE_CARRIER = 2, |
| 42 STATE_ASSOCIATION = 3, |
| 43 STATE_CONFIGURATION = 4, |
| 44 STATE_READY = 5, |
| 45 STATE_DISCONNECT = 6, |
| 46 STATE_FAILURE = 7, |
| 47 STATE_ACTIVATION_FAILURE = 8 |
| 48 }; |
| 49 |
| 50 enum ConnectivityState { |
| 51 CONN_STATE_UNKNOWN = 0, |
| 52 CONN_STATE_UNRESTRICTED = 1, |
| 53 CONN_STATE_RESTRICTED = 2, |
| 54 CONN_STATE_NONE = 3 |
| 55 }; |
| 56 |
| 57 // Network enums (see flimflam/include/network.h) |
| 58 enum NetworkTechnology { |
| 59 NETWORK_TECHNOLOGY_UNKNOWN = 0, |
| 60 NETWORK_TECHNOLOGY_1XRTT = 1, |
| 61 NETWORK_TECHNOLOGY_EVDO = 2, |
| 62 NETWORK_TECHNOLOGY_GPRS = 3, |
| 63 NETWORK_TECHNOLOGY_EDGE = 4, |
| 64 NETWORK_TECHNOLOGY_UMTS = 5, |
| 65 NETWORK_TECHNOLOGY_HSPA = 6, |
| 66 NETWORK_TECHNOLOGY_HSPA_PLUS = 7, |
| 67 NETWORK_TECHNOLOGY_LTE = 8, |
| 68 NETWORK_TECHNOLOGY_LTE_ADVANCED = 9, |
| 69 }; |
| 70 |
| 71 enum ActivationState { |
| 72 ACTIVATION_STATE_UNKNOWN = 0, |
| 73 ACTIVATION_STATE_ACTIVATED = 1, |
| 74 ACTIVATION_STATE_ACTIVATING = 2, |
| 75 ACTIVATION_STATE_NOT_ACTIVATED = 3, |
| 76 ACTIVATION_STATE_PARTIALLY_ACTIVATED = 4, |
| 77 }; |
| 78 |
| 79 enum NetworkRoamingState { |
| 80 ROAMING_STATE_UNKNOWN = 0, |
| 81 ROAMING_STATE_HOME = 1, |
| 82 ROAMING_STATE_ROAMING = 2, |
| 83 }; |
| 84 |
| 85 // connection errors (see flimflam/include/service.h) |
| 86 enum ConnectionError { |
| 87 ERROR_UNKNOWN = 0, |
| 88 ERROR_OUT_OF_RANGE = 1, |
| 89 ERROR_PIN_MISSING = 2, |
| 90 ERROR_DHCP_FAILED = 3, |
| 91 ERROR_CONNECT_FAILED = 4, |
| 92 ERROR_BAD_PASSPHRASE = 5, |
| 93 ERROR_BAD_WEPKEY = 6, |
| 94 ERROR_ACTIVATION_FAILED = 7, |
| 95 ERROR_NEED_EVDO = 8, |
| 96 ERROR_NEED_HOME_NETWORK = 9, |
| 97 ERROR_OTASP_FAILED = 10, |
| 98 ERROR_AAA_FAILED = 11, |
| 99 }; |
| 100 |
13 // Device Info for cellular devices. | 101 // Device Info for cellular devices. |
14 struct DeviceInfo { | 102 struct DeviceInfo { |
15 const char* carrier; | 103 const char* carrier; |
16 const char* MEID; | 104 const char* MEID; |
17 const char* IMEI; | 105 const char* IMEI; |
18 const char* IMSI; | 106 const char* IMSI; |
19 const char* ESN; | 107 const char* ESN; |
20 const char* MDN; | 108 const char* MDN; |
21 const char* MIN; | 109 const char* MIN; |
22 const char* model_id; | 110 const char* model_id; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 ServiceInfo* GetRememberedServiceInfo(int index) { | 190 ServiceInfo* GetRememberedServiceInfo(int index) { |
103 size_t ptr = reinterpret_cast<size_t>(remembered_services); | 191 size_t ptr = reinterpret_cast<size_t>(remembered_services); |
104 return reinterpret_cast<ServiceInfo*>(ptr + index * service_info_size); | 192 return reinterpret_cast<ServiceInfo*>(ptr + index * service_info_size); |
105 } | 193 } |
106 DeviceInfo* GetDeviceInfo(int index) { | 194 DeviceInfo* GetDeviceInfo(int index) { |
107 size_t ptr = reinterpret_cast<size_t>(devices); | 195 size_t ptr = reinterpret_cast<size_t>(devices); |
108 return reinterpret_cast<DeviceInfo*>(ptr + index * device_info_size); | 196 return reinterpret_cast<DeviceInfo*>(ptr + index * device_info_size); |
109 } | 197 } |
110 }; | 198 }; |
111 | 199 |
| 200 // Requests a scan of services of |type|. |
| 201 // If |type| is TYPE_UNKNOWN (0), it will scan for all types. |
| 202 extern void (*RequestScan)(ConnectionType type); |
| 203 |
112 // Gets a ServiceInfo for a wifi service with |ssid| and |security|. | 204 // Gets a ServiceInfo for a wifi service with |ssid| and |security|. |
113 // If an open network is not found, then it will create a hidden network and | 205 // If an open network is not found, then it will create a hidden network and |
114 // return the ServiceInfo for that. | 206 // return the ServiceInfo for that. |
115 // The ServiceInfo instance that is returned by this function MUST be | 207 // The ServiceInfo instance that is returned by this function MUST be |
116 // deleted with by calling FreeServiceInfo. | 208 // deleted with by calling FreeServiceInfo. |
117 // | 209 // |
118 // Returns NULL on error. | 210 // Returns NULL on error. |
119 extern ServiceInfo* (*GetWifiService)(const char* ssid, | 211 extern ServiceInfo* (*GetWifiService)(const char* ssid, |
120 ConnectionSecurity security); | 212 ConnectionSecurity security); |
121 | 213 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // The provided MonitorNetworkCallback will be called whenever that happens. | 259 // The provided MonitorNetworkCallback will be called whenever that happens. |
168 // MonitorNetwork is deprecated: use MonitorNetworkManager. | 260 // MonitorNetwork is deprecated: use MonitorNetworkManager. |
169 extern MonitorNetworkConnection (*MonitorNetwork)( | 261 extern MonitorNetworkConnection (*MonitorNetwork)( |
170 MonitorNetworkCallback callback, | 262 MonitorNetworkCallback callback, |
171 void* object); | 263 void* object); |
172 | 264 |
173 // Disconnects a MonitorNetworkConnection. | 265 // Disconnects a MonitorNetworkConnection. |
174 // DisconnectMonitorNetwork is deprecated: use DisconnectPropertyChangeMonitor. | 266 // DisconnectMonitorNetwork is deprecated: use DisconnectPropertyChangeMonitor. |
175 extern void (*DisconnectMonitorNetwork)(MonitorNetworkConnection connection); | 267 extern void (*DisconnectMonitorNetwork)(MonitorNetworkConnection connection); |
176 | 268 |
| 269 // Returns false on failure and true on success. |
| 270 extern bool (*EnableNetworkDevice)(ConnectionType type, bool enable); |
| 271 |
| 272 // Request a wifi service not in the network list (i.e. hidden). |
| 273 // Get a service path for a wifi service not in the network list (i.e. hidden). |
| 274 extern void (*RequestWifiServicePath)(const char* ssid, |
| 275 ConnectionSecurity security, |
| 276 NetworkPropertiesCallback callback, |
| 277 void* object); |
| 278 |
177 } // namespace chromeos | 279 } // namespace chromeos |
178 | 280 |
179 #endif // CHROMEOS_NETWORK_DEPRECATED_H_ | 281 #endif // CHROMEOS_NETWORK_DEPRECATED_H_ |
OLD | NEW |