blob: e474328afa79897d4479726578b1a7627c5adecd [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
Paul Stewart0654ece2013-03-26 15:21:26 -070012#include <dbus-c++/dbus.h>
mukesh agrawal6e277772011-09-29 15:04:23 -070013
14namespace shill {
15
Paul Stewart0654ece2013-03-26 15:21:26 -070016class WPASupplicant {
17 public:
18 static const char kBSSPropertyBSSID[];
19 static const char kBSSPropertyFrequency[];
20 static const char kBSSPropertyIEs[];
21 static const char kBSSPropertyMode[];
22 static const char kBSSPropertyRates[];
23 static const char kBSSPropertySSID[];
24 static const char kBSSPropertySignal[];
25 static const char kCaPath[];
26 static const char kCurrentBSSNull[];
27 static const char kDBusAddr[];
28 static const char kDBusPath[];
29 static const char kDebugLevelDebug[];
30 static const char kDebugLevelError[];
31 static const char kDebugLevelExcessive[];
32 static const char kDebugLevelInfo[];
33 static const char kDebugLevelMsgDump[];
34 static const char kDebugLevelWarning[];
35 static const char kDriverNL80211[];
Paul Stewart196f50f2013-03-27 18:02:11 -070036 static const char kDriverWired[];
Paul Stewart0654ece2013-03-26 15:21:26 -070037 static const char kEAPParameterAlertUnknownCA[];
38 static const char kEAPParameterFailure[];
39 static const char kEAPParameterSuccess[];
Paul Stewart11c224b2013-10-22 19:04:40 -070040 static const char kEAPRequestedParameterPIN[];
Paul Stewart0654ece2013-03-26 15:21:26 -070041 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[];
Paul Stewart9d97b7d2014-03-13 21:47:03 -070081 static const char kNetworkPropertyDisableVHT[];
Paul Stewart0654ece2013-03-26 15:21:26 -070082 static const char kNetworkPropertyEapKeyManagement[];
83 static const char kNetworkPropertyEapIdentity[];
84 static const char kNetworkPropertyEapEap[];
85 static const char kNetworkPropertyEapInnerEap[];
86 static const char kNetworkPropertyEapAnonymousIdentity[];
87 static const char kNetworkPropertyEapClientCert[];
88 static const char kNetworkPropertyEapPrivateKey[];
89 static const char kNetworkPropertyEapPrivateKeyPassword[];
90 static const char kNetworkPropertyEapCaCert[];
91 static const char kNetworkPropertyEapCaPassword[];
92 static const char kNetworkPropertyEapCertId[];
93 static const char kNetworkPropertyEapKeyId[];
94 static const char kNetworkPropertyEapCaCertId[];
95 static const char kNetworkPropertyEapPin[];
96 static const char kNetworkPropertyEapSubjectMatch[];
Paul Stewart9413bcc2013-04-04 16:12:43 -070097 static const char kNetworkPropertyEapolFlags[];
Paul Stewart0654ece2013-03-26 15:21:26 -070098 static const char kNetworkPropertyEngine[];
99 static const char kNetworkPropertyEngineId[];
100 static const char kNetworkPropertyFrequency[];
101 static const char kNetworkPropertyIeee80211w[];
102 static const char kNetworkPropertyMode[];
103 static const char kNetworkPropertySSID[];
104 static const char kNetworkPropertyScanSSID[];
mukesh agrawal64896322011-12-01 01:13:10 +0000105// TODO(quiche): Make the naming scheme more consistent, by adding the
Paul Stewartee6b3d72013-07-12 16:07:51 -0700106// object type to the property names below. (crbug.com/206642)
Paul Stewart0654ece2013-03-26 15:21:26 -0700107 static const char kPropertyAuthAlg[];
108 static const char kPropertyBSSID[];
109 static const char kPropertyMode[];
110 static const char kPropertyPreSharedKey[];
111 static const char kPropertyPrivacy[];
112 static const char kPropertyRSN[];
113 static const char kPropertyScanSSIDs[];
114 static const char kPropertyScanType[];
115 static const char kPropertySecurityProtocol[];
116 static const char kPropertySignal[];
117 static const char kPropertyWEPKey[];
118 static const char kPropertyWEPTxKeyIndex[];
119 static const char kPropertyWPA[];
120 static const char kScanTypeActive[];
121 static const char kSecurityAuthAlg[];
122 static const char kSecurityMethodPropertyKeyManagement[];
123 static const char kSecurityModeRSN[];
124 static const char kSecurityModeWPA[];
Paul Stewartc6fbad92013-11-13 14:50:52 -0800125 static const char kTDLSStateConnected[];
126 static const char kTDLSStateDisabled[];
127 static const char kTDLSStatePeerDoesNotExist[];
128 static const char kTDLSStatePeerNotConnected[];
mukesh agrawal6e277772011-09-29 15:04:23 -0700129
Paul Stewart0654ece2013-03-26 15:21:26 -0700130 static const uint32_t kDefaultEngine;
131 static const uint32_t kNetworkIeee80211wDisabled;
132 static const uint32_t kNetworkIeee80211wEnabled;
133 static const uint32_t kNetworkIeee80211wRequired;
134 static const uint32_t kNetworkModeInfrastructureInt;
135 static const uint32_t kNetworkModeAdHocInt;
136 static const uint32_t kNetworkModeAccessPointInt;
137 static const uint32_t kScanMaxSSIDsPerScan;
138
Paul Stewart196f50f2013-03-27 18:02:11 -0700139 static const char kSupplicantConfPath[];
140
Paul Stewart735eab52013-03-29 09:19:23 -0700141 // Retrieve the |subject| and |depth| of an a remote certifying entity,
142 // as contained the the |properties| to a Certification event from
143 // wpa_supplicant. Returns true if an |subject| and |depth| were
144 // extracted successfully, false otherwise.
145 static bool ExtractRemoteCertification(
146 const std::map<std::string, DBus::Variant> &properties,
Ben Chan7fab8972014-08-10 17:14:46 -0700147 std::string *subject, uint32_t *depth);
mukesh agrawal6e277772011-09-29 15:04:23 -0700148};
149
150} // namespace shill
151
Ben Chanc45688b2014-07-02 23:50:45 -0700152#endif // SHILL_WPA_SUPPLICANT_H_