blob: e830a2f4eb691353428be596a568f1a00f480036 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
// Copyright (c) 2011 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.
#include "chrome/browser/chromeos/cros/native_network_constants.h"
namespace chromeos {
// Format of the Carrier ID: <carrier name> (<carrier country>).
const char kCarrierIdFormat[] = "%s (%s)";
// Path of the default (shared) flimflam profile.
const char kSharedProfilePath[] = "/profile/default";
// D-Bus interface string constants.
// Flimflam manager properties.
const char kAvailableTechnologiesProperty[] = "AvailableTechnologies";
const char kEnabledTechnologiesProperty[] = "EnabledTechnologies";
const char kConnectedTechnologiesProperty[] = "ConnectedTechnologies";
const char kDefaultTechnologyProperty[] = "DefaultTechnology";
const char kOfflineModeProperty[] = "OfflineMode";
const char kActiveProfileProperty[] = "ActiveProfile";
const char kProfilesProperty[] = "Profiles";
const char kServicesProperty[] = "Services";
const char kServiceWatchListProperty[] = "ServiceWatchList";
const char kDevicesProperty[] = "Devices";
const char kPortalUrlProperty[] = "PortalURL";
const char kCheckPortalListProperty[] = "CheckPortalList";
const char kArpGatewayProperty[] = "ArpGateway";
// Flimflam service properties.
const char kSecurityProperty[] = "Security";
const char kPassphraseProperty[] = "Passphrase";
const char kIdentityProperty[] = "Identity";
const char kPassphraseRequiredProperty[] = "PassphraseRequired";
const char kSaveCredentialsProperty[] = "SaveCredentials";
const char kSignalStrengthProperty[] = "Strength";
const char kNameProperty[] = "Name";
const char kGuidProperty[] = "GUID";
const char kStateProperty[] = "State";
const char kTypeProperty[] = "Type";
const char kDeviceProperty[] = "Device";
const char kProfileProperty[] = "Profile";
const char kTechnologyFamilyProperty[] = "Cellular.Family";
const char kActivationStateProperty[] = "Cellular.ActivationState";
const char kNetworkTechnologyProperty[] = "Cellular.NetworkTechnology";
const char kRoamingStateProperty[] = "Cellular.RoamingState";
const char kOperatorNameProperty[] = "Cellular.OperatorName";
const char kOperatorCodeProperty[] = "Cellular.OperatorCode";
const char kServingOperatorProperty[] = "Cellular.ServingOperator";
const char kPaymentUrlProperty[] = "Cellular.OlpUrl";
const char kUsageUrlProperty[] = "Cellular.UsageUrl";
const char kCellularApnProperty[] = "Cellular.APN";
const char kCellularLastGoodApnProperty[] = "Cellular.LastGoodAPN";
const char kCellularApnListProperty[] = "Cellular.APNList";
const char kWifiHexSsid[] = "WiFi.HexSSID";
const char kWifiFrequency[] = "WiFi.Frequency";
const char kWifiHiddenSsid[] = "WiFi.HiddenSSID";
const char kWifiPhyMode[] = "WiFi.PhyMode";
const char kWifiAuthMode[] = "WiFi.AuthMode";
const char kFavoriteProperty[] = "Favorite";
const char kConnectableProperty[] = "Connectable";
const char kPriorityProperty[] = "Priority";
const char kAutoConnectProperty[] = "AutoConnect";
const char kIsActiveProperty[] = "IsActive";
const char kModeProperty[] = "Mode";
const char kErrorProperty[] = "Error";
const char kEntriesProperty[] = "Entries";
const char kProviderProperty[] = "Provider";
const char kHostProperty[] = "Host";
const char kProxyConfigProperty[] = "ProxyConfig";
// Flimflam property names for SIMLock status.
const char kSimLockStatusProperty[] = "Cellular.SIMLockStatus";
const char kSimLockTypeProperty[] = "LockType";
const char kSimLockRetriesLeftProperty[] = "RetriesLeft";
// Flimflam property names for Cellular.FoundNetworks.
const char kLongNameProperty[] = "long_name";
const char kStatusProperty[] = "status";
const char kShortNameProperty[] = "short_name";
const char kTechnologyProperty[] = "technology";
const char kNetworkIdProperty[] = "network_id";
// Flimflam SIMLock status types.
const char kSimLockPin[] = "sim-pin";
const char kSimLockPuk[] = "sim-puk";
// APN info property names.
const char kApnProperty[] = "apn";
const char kApnNetworkIdProperty[] = "network_id";
const char kApnUsernameProperty[] = "username";
const char kApnPasswordProperty[] = "password";
const char kApnNameProperty[] = "name";
const char kApnLocalizedNameProperty[] = "localized_name";
const char kApnLanguageProperty[] = "language";
// Operator info property names.
const char kOperatorNameKey[] = "name";
const char kOperatorCodeKey[] = "code";
const char kOperatorCountryKey[] = "country";
// Flimflam device info property names.
const char kScanningProperty[] = "Scanning";
const char kPoweredProperty[] = "Powered";
const char kNetworksProperty[] = "Networks";
const char kCarrierProperty[] = "Cellular.Carrier";
const char kCellularAllowRoamingProperty[] = "Cellular.AllowRoaming";
const char kHomeProviderProperty[] = "Cellular.HomeProvider";
const char kMeidProperty[] = "Cellular.MEID";
const char kImeiProperty[] = "Cellular.IMEI";
const char kImsiProperty[] = "Cellular.IMSI";
const char kEsnProperty[] = "Cellular.ESN";
const char kMdnProperty[] = "Cellular.MDN";
const char kMinProperty[] = "Cellular.MIN";
const char kModelIdProperty[] = "Cellular.ModelID";
const char kManufacturerProperty[] = "Cellular.Manufacturer";
const char kFirmwareRevisionProperty[] = "Cellular.FirmwareRevision";
const char kHardwareRevisionProperty[] = "Cellular.HardwareRevision";
const char kPrlVersionProperty[] = "Cellular.PRLVersion"; // (INT16)
const char kSelectedNetworkProperty[] = "Cellular.SelectedNetwork";
const char kSupportNetworkScanProperty[] = "Cellular.SupportNetworkScan";
const char kFoundNetworksProperty[] = "Cellular.FoundNetworks";
// Flimflam ip config property names.
const char kAddressProperty[] = "Address";
const char kPrefixlenProperty[] = "Prefixlen";
const char kGatewayProperty[] = "Gateway";
const char kNameServersProperty[] = "NameServers";
// Flimflam type options.
const char kTypeEthernet[] = "ethernet";
const char kTypeWifi[] = "wifi";
const char kTypeWimax[] = "wimax";
const char kTypeBluetooth[] = "bluetooth";
const char kTypeCellular[] = "cellular";
const char kTypeVpn[] = "vpn";
// Flimflam mode options.
const char kModeManaged[] = "managed";
const char kModeAdhoc[] = "adhoc";
// Flimflam security options.
const char kSecurityWpa[] = "wpa";
const char kSecurityWep[] = "wep";
const char kSecurityRsn[] = "rsn";
const char kSecurity8021x[] = "802_1x";
const char kSecurityPsk[] = "psk";
const char kSecurityNone[] = "none";
// Flimflam L2TPIPsec property names.
const char kL2tpIpsecCaCertNssProperty[] = "L2TPIPsec.CACertNSS";
const char kL2tpIpsecClientCertIdProperty[] = "L2TPIPsec.ClientCertID";
const char kL2tpIpsecClientCertSlotProp[] = "L2TPIPsec.ClientCertSlot";
const char kL2tpIpsecPinProperty[] = "L2TPIPsec.PIN";
const char kL2tpIpsecPskProperty[] = "L2TPIPsec.PSK";
const char kL2tpIpsecUserProperty[] = "L2TPIPsec.User";
const char kL2tpIpsecPasswordProperty[] = "L2TPIPsec.Password";
// Flimflam EAP property names.
// See src/third_party/flimflam/doc/service-api.txt.
const char kEapIdentityProperty[] = "EAP.Identity";
const char kEapMethodProperty[] = "EAP.EAP";
const char kEapPhase2AuthProperty[] = "EAP.InnerEAP";
const char kEapAnonymousIdentityProperty[] = "EAP.AnonymousIdentity";
const char kEapClientCertProperty[] = "EAP.ClientCert"; // path
const char kEapCertIdProperty[] = "EAP.CertID"; // PKCS#11 ID
const char kEapClientCertNssProperty[] = "EAP.ClientCertNSS"; // NSS nickname
const char kEapPrivateKeyProperty[] = "EAP.PrivateKey";
const char kEapPrivateKeyPasswordProperty[] = "EAP.PrivateKeyPassword";
const char kEapKeyIdProperty[] = "EAP.KeyID";
const char kEapCaCertProperty[] = "EAP.CACert"; // server CA cert path
const char kEapCaCertIdProperty[] = "EAP.CACertID"; // server CA PKCS#11 ID
const char kEapCaCertNssProperty[] = "EAP.CACertNSS"; // server CA NSS nickname
const char kEapUseSystemCasProperty[] = "EAP.UseSystemCAs";
const char kEapPinProperty[] = "EAP.PIN";
const char kEapPasswordProperty[] = "EAP.Password";
const char kEapKeyMgmtProperty[] = "EAP.KeyMgmt";
// Flimflam EAP method options.
const char kEapMethodPeap[] = "PEAP";
const char kEapMethodTls[] = "TLS";
const char kEapMethodTtls[] = "TTLS";
const char kEapMethodLeap[] = "LEAP";
// Flimflam EAP phase 2 auth options.
const char kEapPhase2AuthPeapMd5[] = "auth=MD5";
const char kEapPhase2AuthPeapMschap2[] = "auth=MSCHAPV2";
const char kEapPhase2AuthTtlsMd5[] = "autheap=MD5";
const char kEapPhase2AuthTtlsMschapV2[] = "autheap=MSCHAPV2";
const char kEapPhase2AuthTtlsMschap[] = "autheap=MSCHAP";
const char kEapPhase2AuthTtlsPap[] = "autheap=PAP";
const char kEapPhase2AuthTtlsChap[] = "autheap=CHAP";
// Flimflam VPN provider types.
const char kProviderL2tpIpsec[] = "l2tpipsec";
const char kProviderOpenVpn[] = "openvpn";
// Flimflam state options.
const char kStateIdle[] = "idle";
const char kStateCarrier[] = "carrier";
const char kStateAssociation[] = "association";
const char kStateConfiguration[] = "configuration";
const char kStateReady[] = "ready";
const char kStatePortal[] = "portal";
const char kStateOnline[] = "online";
const char kStateDisconnect[] = "disconnect";
const char kStateFailure[] = "failure";
const char kStateActivationFailure[] = "activation-failure";
// Flimflam network technology options.
const char kNetworkTechnology1Xrtt[] = "1xRTT";
const char kNetworkTechnologyEvdo[] = "EVDO";
const char kNetworkTechnologyGprs[] = "GPRS";
const char kNetworkTechnologyEdge[] = "EDGE";
const char kNetworkTechnologyUmts[] = "UMTS";
const char kNetworkTechnologyHspa[] = "HSPA";
const char kNetworkTechnologyHspaPlus[] = "HSPA+";
const char kNetworkTechnologyLte[] = "LTE";
const char kNetworkTechnologyLteAdvanced[] = "LTE Advanced";
const char kNetworkTechnologyGsm[] = "GSM";
// Flimflam roaming state options
const char kRoamingStateHome[] = "home";
const char kRoamingStateRoaming[] = "roaming";
const char kRoamingStateUnknown[] = "unknown";
// Flimflam activation state options
const char kActivationStateActivated[] = "activated";
const char kActivationStateActivating[] = "activating";
const char kActivationStateNotActivated[] = "not-activated";
const char kActivationStatePartiallyActivated[] = "partially-activated";
const char kActivationStateUnknown[] = "unknown";
// FlimFlam technology family options
const char kTechnologyFamilyCdma[] = "CDMA";
const char kTechnologyFamilyGsm[] = "GSM";
// Flimflam error options.
const char kErrorOutOfRange[] = "out-of-range";
const char kErrorPinMissing[] = "pin-missing";
const char kErrorDhcpFailed[] = "dhcp-failed";
const char kErrorConnectFailed[] = "connect-failed";
const char kErrorBadPassphrase[] = "bad-passphrase";
const char kErrorBadWepKey[] = "bad-wepkey";
const char kErrorActivationFailed[] = "activation-failed";
const char kErrorNeedEvdo[] = "need-evdo";
const char kErrorNeedHomeNetwork[] = "need-home-network";
const char kErrorOtaspFailed[] = "otasp-failed";
const char kErrorAaaFailed[] = "aaa-failed";
const char kErrorInternal[] = "internal-error";
const char kErrorDnsLookupFailed[] = "dns-lookup-failed";
const char kErrorHttpGetFailed[] = "http-get-failed";
// Flimflam error messages.
const char kErrorPassphraseRequiredMsg[] = "Passphrase required";
const char kErrorIncorrectPinMsg[] = "org.chromium.flimflam.Error.IncorrectPin";
const char kErrorPinBlockedMsg[] = "org.chromium.flimflam.Error.PinBlocked";
const char kErrorPinRequiredMsg[] = "org.chromium.flimflam.Error.PinRequired";
const char kUnknownString[] = "UNKNOWN";
////////////////////////////////////////////////////////////////////////////
const char* ConnectionTypeToString(ConnectionType type) {
switch (type) {
case TYPE_UNKNOWN:
break;
case TYPE_ETHERNET:
return kTypeEthernet;
case TYPE_WIFI:
return kTypeWifi;
case TYPE_WIMAX:
return kTypeWimax;
case TYPE_BLUETOOTH:
return kTypeBluetooth;
case TYPE_CELLULAR:
return kTypeCellular;
case TYPE_VPN:
return kTypeVpn;
}
LOG(ERROR) << "ConnectionTypeToString called with unknown type: " << type;
return kUnknownString;
}
const char* SecurityToString(ConnectionSecurity security) {
switch (security) {
case SECURITY_NONE:
return kSecurityNone;
case SECURITY_WEP:
return kSecurityWep;
case SECURITY_WPA:
return kSecurityWpa;
case SECURITY_RSN:
return kSecurityRsn;
case SECURITY_8021X:
return kSecurity8021x;
case SECURITY_PSK:
return kSecurityPsk;
case SECURITY_UNKNOWN:
break;
}
LOG(ERROR) << "SecurityToString called with unknown type: " << security;
return kUnknownString;
}
const char* ProviderTypeToString(ProviderType type) {
switch (type) {
case PROVIDER_TYPE_L2TP_IPSEC_PSK:
case PROVIDER_TYPE_L2TP_IPSEC_USER_CERT:
return kProviderL2tpIpsec;
case PROVIDER_TYPE_OPEN_VPN:
return kProviderOpenVpn;
case PROVIDER_TYPE_MAX:
break;
}
LOG(ERROR) << "ProviderTypeToString called with unknown type: " << type;
return kUnknownString;
}
} // namespace chromeos
|