blob: 90728d0c47c40e3d16bbd81e61d1c2255e6fbc83 [file] [log] [blame]
mukesh agrawal4d0401c2012-01-06 16:05:31 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
mukesh agrawal6e277772011-09-29 15:04:23 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SHILL_WPA_SUPPLICANT_H
6#define SHILL_WPA_SUPPLICANT_H
7
Paul Stewart0654ece2013-03-26 15:21:26 -07008#include <map>
9#include <string>
10#include <vector>
11
mukesh agrawal6e277772011-09-29 15:04:23 -070012#include <base/basictypes.h>
Paul Stewart0654ece2013-03-26 15:21:26 -070013#include <dbus-c++/dbus.h>
mukesh agrawal6e277772011-09-29 15:04:23 -070014
15namespace shill {
16
Paul Stewart0654ece2013-03-26 15:21:26 -070017class WPASupplicant {
18 public:
19 static const char kBSSPropertyBSSID[];
20 static const char kBSSPropertyFrequency[];
21 static const char kBSSPropertyIEs[];
22 static const char kBSSPropertyMode[];
23 static const char kBSSPropertyRates[];
24 static const char kBSSPropertySSID[];
25 static const char kBSSPropertySignal[];
26 static const char kCaPath[];
27 static const char kCurrentBSSNull[];
28 static const char kDBusAddr[];
29 static const char kDBusPath[];
30 static const char kDebugLevelDebug[];
31 static const char kDebugLevelError[];
32 static const char kDebugLevelExcessive[];
33 static const char kDebugLevelInfo[];
34 static const char kDebugLevelMsgDump[];
35 static const char kDebugLevelWarning[];
36 static const char kDriverNL80211[];
Paul Stewart196f50f2013-03-27 18:02:11 -070037 static const char kDriverWired[];
Paul Stewart0654ece2013-03-26 15:21:26 -070038 static const char kEAPParameterAlertUnknownCA[];
39 static const char kEAPParameterFailure[];
40 static const char kEAPParameterSuccess[];
41 static const char kEAPStatusAcceptProposedMethod[];
42 static const char kEAPStatusCompletion[];
43 static const char kEAPStatusLocalTLSAlert[];
44 static const char kEAPStatusParameterNeeded[];
45 static const char kEAPStatusRemoteCertificateVerification[];
46 static const char kEAPStatusRemoteTLSAlert[];
47 static const char kEAPStatusStarted[];
48 static const char kEnginePKCS11[];
49 static const char kErrorNetworkUnknown[];
50 static const char kErrorInterfaceExists[];
51 static const char kInterfacePropertyConfigFile[];
52 static const char kInterfacePropertyCurrentBSS[];
53 static const char kInterfacePropertyDepth[];
54 static const char kInterfacePropertyDriver[];
55 static const char kInterfacePropertyName[];
56 static const char kInterfacePropertyState[];
57 static const char kInterfacePropertySubject[];
58 static const char kInterfaceState4WayHandshake[];
59 static const char kInterfaceStateAssociated[];
60 static const char kInterfaceStateAssociating[];
61 static const char kInterfaceStateAuthenticating[];
62 static const char kInterfaceStateCompleted[];
63 static const char kInterfaceStateDisconnected[];
64 static const char kInterfaceStateGroupHandshake[];
65 static const char kInterfaceStateInactive[];
66 static const char kInterfaceStateScanning[];
Paul Stewart9413bcc2013-04-04 16:12:43 -070067 static const char kKeyManagementIeee8021X[];
Paul Stewart0654ece2013-03-26 15:21:26 -070068 static const char kKeyManagementMethodSuffixEAP[];
69 static const char kKeyManagementMethodSuffixPSK[];
70 static const char kKeyModeNone[];
71 static const char kNetworkBgscanMethodLearn[];
Christopher Wileya998df22012-07-11 15:14:55 -070072// None is not a real method name, but we interpret 'none' as a request that
73// no background scan parameter should be supplied to wpa_supplicant.
Paul Stewart0654ece2013-03-26 15:21:26 -070074 static const char kNetworkBgscanMethodNone[];
75 static const char kNetworkBgscanMethodSimple[];
76 static const char kNetworkModeInfrastructure[];
77 static const char kNetworkModeAdHoc[];
78 static const char kNetworkModeAccessPoint[];
79 static const char kNetworkPropertyBgscan[];
80 static const char kNetworkPropertyCaPath[];
81 static const char kNetworkPropertyEapKeyManagement[];
82 static const char kNetworkPropertyEapIdentity[];
83 static const char kNetworkPropertyEapEap[];
84 static const char kNetworkPropertyEapInnerEap[];
85 static const char kNetworkPropertyEapAnonymousIdentity[];
86 static const char kNetworkPropertyEapClientCert[];
87 static const char kNetworkPropertyEapPrivateKey[];
88 static const char kNetworkPropertyEapPrivateKeyPassword[];
89 static const char kNetworkPropertyEapCaCert[];
90 static const char kNetworkPropertyEapCaPassword[];
91 static const char kNetworkPropertyEapCertId[];
92 static const char kNetworkPropertyEapKeyId[];
93 static const char kNetworkPropertyEapCaCertId[];
94 static const char kNetworkPropertyEapPin[];
95 static const char kNetworkPropertyEapSubjectMatch[];
Paul Stewart9413bcc2013-04-04 16:12:43 -070096 static const char kNetworkPropertyEapolFlags[];
Paul Stewart0654ece2013-03-26 15:21:26 -070097 static const char kNetworkPropertyEngine[];
98 static const char kNetworkPropertyEngineId[];
99 static const char kNetworkPropertyFrequency[];
100 static const char kNetworkPropertyIeee80211w[];
101 static const char kNetworkPropertyMode[];
102 static const char kNetworkPropertySSID[];
103 static const char kNetworkPropertyScanSSID[];
mukesh agrawal64896322011-12-01 01:13:10 +0000104// TODO(quiche): Make the naming scheme more consistent, by adding the
105// object type to the property names below. (crosbug.com/23656)
Paul Stewart0654ece2013-03-26 15:21:26 -0700106 static const char kPropertyAuthAlg[];
107 static const char kPropertyBSSID[];
108 static const char kPropertyMode[];
109 static const char kPropertyPreSharedKey[];
110 static const char kPropertyPrivacy[];
111 static const char kPropertyRSN[];
112 static const char kPropertyScanSSIDs[];
113 static const char kPropertyScanType[];
114 static const char kPropertySecurityProtocol[];
115 static const char kPropertySignal[];
116 static const char kPropertyWEPKey[];
117 static const char kPropertyWEPTxKeyIndex[];
118 static const char kPropertyWPA[];
119 static const char kScanTypeActive[];
120 static const char kSecurityAuthAlg[];
121 static const char kSecurityMethodPropertyKeyManagement[];
122 static const char kSecurityModeRSN[];
123 static const char kSecurityModeWPA[];
mukesh agrawal6e277772011-09-29 15:04:23 -0700124
Paul Stewart0654ece2013-03-26 15:21:26 -0700125 static const uint32_t kDefaultEngine;
126 static const uint32_t kNetworkIeee80211wDisabled;
127 static const uint32_t kNetworkIeee80211wEnabled;
128 static const uint32_t kNetworkIeee80211wRequired;
129 static const uint32_t kNetworkModeInfrastructureInt;
130 static const uint32_t kNetworkModeAdHocInt;
131 static const uint32_t kNetworkModeAccessPointInt;
132 static const uint32_t kScanMaxSSIDsPerScan;
133
Paul Stewart196f50f2013-03-27 18:02:11 -0700134 static const char kSupplicantConfPath[];
135
Paul Stewart735eab52013-03-29 09:19:23 -0700136 // Retrieve the |subject| and |depth| of an a remote certifying entity,
137 // as contained the the |properties| to a Certification event from
138 // wpa_supplicant. Returns true if an |subject| and |depth| were
139 // extracted successfully, false otherwise.
140 static bool ExtractRemoteCertification(
141 const std::map<std::string, DBus::Variant> &properties,
142 std::string *subject, uint32 *depth);
mukesh agrawal6e277772011-09-29 15:04:23 -0700143};
144
145} // namespace shill
146
147#endif // SHILL_WPA_SUPPLICANT_H