blob: 3521fb9ec56cda387ce1a39224c785c2d0f1c575 [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
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_WPA_SUPPLICANT_H_
6#define SHILL_WPA_SUPPLICANT_H_
mukesh agrawal6e277772011-09-29 15:04:23 -07007
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[];
Paul Stewart11c224b2013-10-22 19:04:40 -070041 static const char kEAPRequestedParameterPIN[];
Paul Stewart0654ece2013-03-26 15:21:26 -070042 static const char kEAPStatusAcceptProposedMethod[];
43 static const char kEAPStatusCompletion[];
44 static const char kEAPStatusLocalTLSAlert[];
45 static const char kEAPStatusParameterNeeded[];
46 static const char kEAPStatusRemoteCertificateVerification[];
47 static const char kEAPStatusRemoteTLSAlert[];
48 static const char kEAPStatusStarted[];
49 static const char kEnginePKCS11[];
50 static const char kErrorNetworkUnknown[];
51 static const char kErrorInterfaceExists[];
52 static const char kInterfacePropertyConfigFile[];
53 static const char kInterfacePropertyCurrentBSS[];
54 static const char kInterfacePropertyDepth[];
55 static const char kInterfacePropertyDriver[];
56 static const char kInterfacePropertyName[];
57 static const char kInterfacePropertyState[];
58 static const char kInterfacePropertySubject[];
59 static const char kInterfaceState4WayHandshake[];
60 static const char kInterfaceStateAssociated[];
61 static const char kInterfaceStateAssociating[];
62 static const char kInterfaceStateAuthenticating[];
63 static const char kInterfaceStateCompleted[];
64 static const char kInterfaceStateDisconnected[];
65 static const char kInterfaceStateGroupHandshake[];
66 static const char kInterfaceStateInactive[];
67 static const char kInterfaceStateScanning[];
Paul Stewart9413bcc2013-04-04 16:12:43 -070068 static const char kKeyManagementIeee8021X[];
Paul Stewart0654ece2013-03-26 15:21:26 -070069 static const char kKeyManagementMethodSuffixEAP[];
70 static const char kKeyManagementMethodSuffixPSK[];
71 static const char kKeyModeNone[];
72 static const char kNetworkBgscanMethodLearn[];
Christopher Wileya998df22012-07-11 15:14:55 -070073// None is not a real method name, but we interpret 'none' as a request that
74// no background scan parameter should be supplied to wpa_supplicant.
Paul Stewart0654ece2013-03-26 15:21:26 -070075 static const char kNetworkBgscanMethodNone[];
76 static const char kNetworkBgscanMethodSimple[];
77 static const char kNetworkModeInfrastructure[];
78 static const char kNetworkModeAdHoc[];
79 static const char kNetworkModeAccessPoint[];
80 static const char kNetworkPropertyBgscan[];
81 static const char kNetworkPropertyCaPath[];
Paul Stewart9d97b7d2014-03-13 21:47:03 -070082 static const char kNetworkPropertyDisableVHT[];
Paul Stewart0654ece2013-03-26 15:21:26 -070083 static const char kNetworkPropertyEapKeyManagement[];
84 static const char kNetworkPropertyEapIdentity[];
85 static const char kNetworkPropertyEapEap[];
86 static const char kNetworkPropertyEapInnerEap[];
87 static const char kNetworkPropertyEapAnonymousIdentity[];
88 static const char kNetworkPropertyEapClientCert[];
89 static const char kNetworkPropertyEapPrivateKey[];
90 static const char kNetworkPropertyEapPrivateKeyPassword[];
91 static const char kNetworkPropertyEapCaCert[];
92 static const char kNetworkPropertyEapCaPassword[];
93 static const char kNetworkPropertyEapCertId[];
94 static const char kNetworkPropertyEapKeyId[];
95 static const char kNetworkPropertyEapCaCertId[];
96 static const char kNetworkPropertyEapPin[];
97 static const char kNetworkPropertyEapSubjectMatch[];
Paul Stewart9413bcc2013-04-04 16:12:43 -070098 static const char kNetworkPropertyEapolFlags[];
Paul Stewart0654ece2013-03-26 15:21:26 -070099 static const char kNetworkPropertyEngine[];
100 static const char kNetworkPropertyEngineId[];
101 static const char kNetworkPropertyFrequency[];
102 static const char kNetworkPropertyIeee80211w[];
103 static const char kNetworkPropertyMode[];
104 static const char kNetworkPropertySSID[];
105 static const char kNetworkPropertyScanSSID[];
mukesh agrawal64896322011-12-01 01:13:10 +0000106// TODO(quiche): Make the naming scheme more consistent, by adding the
Paul Stewartee6b3d72013-07-12 16:07:51 -0700107// object type to the property names below. (crbug.com/206642)
Paul Stewart0654ece2013-03-26 15:21:26 -0700108 static const char kPropertyAuthAlg[];
109 static const char kPropertyBSSID[];
110 static const char kPropertyMode[];
111 static const char kPropertyPreSharedKey[];
112 static const char kPropertyPrivacy[];
113 static const char kPropertyRSN[];
114 static const char kPropertyScanSSIDs[];
115 static const char kPropertyScanType[];
116 static const char kPropertySecurityProtocol[];
117 static const char kPropertySignal[];
118 static const char kPropertyWEPKey[];
119 static const char kPropertyWEPTxKeyIndex[];
120 static const char kPropertyWPA[];
121 static const char kScanTypeActive[];
122 static const char kSecurityAuthAlg[];
123 static const char kSecurityMethodPropertyKeyManagement[];
124 static const char kSecurityModeRSN[];
125 static const char kSecurityModeWPA[];
Paul Stewartc6fbad92013-11-13 14:50:52 -0800126 static const char kTDLSStateConnected[];
127 static const char kTDLSStateDisabled[];
128 static const char kTDLSStatePeerDoesNotExist[];
129 static const char kTDLSStatePeerNotConnected[];
mukesh agrawal6e277772011-09-29 15:04:23 -0700130
Paul Stewart0654ece2013-03-26 15:21:26 -0700131 static const uint32_t kDefaultEngine;
132 static const uint32_t kNetworkIeee80211wDisabled;
133 static const uint32_t kNetworkIeee80211wEnabled;
134 static const uint32_t kNetworkIeee80211wRequired;
135 static const uint32_t kNetworkModeInfrastructureInt;
136 static const uint32_t kNetworkModeAdHocInt;
137 static const uint32_t kNetworkModeAccessPointInt;
138 static const uint32_t kScanMaxSSIDsPerScan;
139
Paul Stewart196f50f2013-03-27 18:02:11 -0700140 static const char kSupplicantConfPath[];
141
Paul Stewart735eab52013-03-29 09:19:23 -0700142 // Retrieve the |subject| and |depth| of an a remote certifying entity,
143 // as contained the the |properties| to a Certification event from
144 // wpa_supplicant. Returns true if an |subject| and |depth| were
145 // extracted successfully, false otherwise.
146 static bool ExtractRemoteCertification(
147 const std::map<std::string, DBus::Variant> &properties,
148 std::string *subject, uint32 *depth);
mukesh agrawal6e277772011-09-29 15:04:23 -0700149};
150
151} // namespace shill
152
Ben Chanc45688b2014-07-02 23:50:45 -0700153#endif // SHILL_WPA_SUPPLICANT_H_