• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

Revisão06683a0564b2c96a710151070e9a7283bbf8f2e8 (tree)
Hora2009-05-14 04:52:53
AutorSan Mehat <san@goog...>
CommiterThe Android Open Source Project

Mensagem de Log

am 82a2116: nexus: Initial support for manipulating wifi networks + chan

Merge commit '82a2116e6b67db910bba22c4874e6ca5efd3eec0'

* commit '82a2116e6b67db910bba22c4874e6ca5efd3eec0':

nexus: Initial support for manipulating wifi networks + change wifi scan notification msgs

Mudança Sumário

Diff

--- a/nexus/Android.mk
+++ b/nexus/Android.mk
@@ -20,6 +20,7 @@ LOCAL_SRC_FILES:= \
2020 VpnController.cpp \
2121 ScanResult.cpp \
2222 WifiScanner.cpp \
23+ WifiNetwork.cpp \
2324
2425 LOCAL_MODULE:= nexus
2526
--- a/nexus/CommandListener.cpp
+++ b/nexus/CommandListener.cpp
@@ -33,6 +33,11 @@ CommandListener::CommandListener() :
3333 registerCmd(new WifiDisableCmd());
3434 registerCmd(new WifiScanCmd());
3535 registerCmd(new WifiScanResultsCmd());
36+ registerCmd(new WifiListNetworksCmd());
37+ registerCmd(new WifiAddNetworkCmd());
38+ registerCmd(new WifiRemoveNetworkCmd());
39+ registerCmd(new WifiSetVarCmd());
40+ registerCmd(new WifiGetVarCmd());
3641
3742 registerCmd(new VpnEnableCmd());
3843 registerCmd(new VpnDisableCmd());
@@ -70,13 +75,46 @@ int CommandListener::WifiDisableCmd::runCommand(SocketClient *cli, char *data) {
7075 return 0;
7176 }
7277
78+CommandListener::WifiAddNetworkCmd::WifiAddNetworkCmd() :
79+ NexusCommand("wifi_add_network") {
80+}
81+
82+int CommandListener::WifiAddNetworkCmd::runCommand(SocketClient *cli, char *data) {
83+ NetworkManager *nm = NetworkManager::Instance();
84+ WifiController *wc = (WifiController *) nm->findController("WIFI");
85+ int networkId;
86+
87+ if ((networkId = wc->addNetwork()) < 0)
88+ cli->sendMsg(ErrorCode::OperationFailed, "Failed to add network", true);
89+ else {
90+ char tmp[128];
91+ sprintf(tmp, "Added network id %d.", networkId);
92+ cli->sendMsg(ErrorCode::CommandOkay, tmp, false);
93+ }
94+ return 0;
95+}
96+
97+CommandListener::WifiRemoveNetworkCmd::WifiRemoveNetworkCmd() :
98+ NexusCommand("wifi_remove_network") {
99+}
100+
101+int CommandListener::WifiRemoveNetworkCmd::runCommand(SocketClient *cli, char *data) {
102+ NetworkManager *nm = NetworkManager::Instance();
103+ WifiController *wc = (WifiController *) nm->findController("WIFI");
104+
105+ if (wc->removeNetwork(atoi(data)))
106+ cli->sendMsg(ErrorCode::OperationFailed, "Failed to remove network", true);
107+ else {
108+ cli->sendMsg(ErrorCode::CommandOkay, "Network removed.", false);
109+ }
110+ return 0;
111+}
112+
73113 CommandListener::WifiScanCmd::WifiScanCmd() :
74114 NexusCommand("wifi_scan") {
75115 }
76116
77117 int CommandListener::WifiScanCmd::runCommand(SocketClient *cli, char *data) {
78- LOGD("WifiScanCmd(%s)", data);
79-
80118 WifiController *wc = (WifiController *) NetworkManager::Instance()->findController("WIFI");
81119
82120 if (wc->setScanMode(atoi(data)))
@@ -93,7 +131,6 @@ CommandListener::WifiScanResultsCmd::WifiScanResultsCmd() :
93131
94132 int CommandListener::WifiScanResultsCmd::runCommand(SocketClient *cli, char *data) {
95133 NetworkManager *nm = NetworkManager::Instance();
96-
97134 WifiController *wc = (WifiController *) nm->findController("WIFI");
98135
99136 ScanResultCollection *src = wc->createScanResults();
@@ -104,7 +141,7 @@ int CommandListener::WifiScanResultsCmd::runCommand(SocketClient *cli, char *dat
104141 sprintf(buffer, "%s:%u:%d:%s:%s",
105142 (*it)->getBssid(), (*it)->getFreq(), (*it)->getLevel(),
106143 (*it)->getFlags(), (*it)->getSsid());
107- cli->sendMsg(125, buffer, false);
144+ cli->sendMsg(ErrorCode::WifiScanResult, buffer, false);
108145 delete (*it);
109146 it = src->erase(it);
110147 }
@@ -114,6 +151,99 @@ int CommandListener::WifiScanResultsCmd::runCommand(SocketClient *cli, char *dat
114151 return 0;
115152 }
116153
154+CommandListener::WifiListNetworksCmd::WifiListNetworksCmd() :
155+ NexusCommand("wifi_list_networks") {
156+}
157+
158+int CommandListener::WifiListNetworksCmd::runCommand(SocketClient *cli, char *data) {
159+ NetworkManager *nm = NetworkManager::Instance();
160+ WifiController *wc = (WifiController *) nm->findController("WIFI");
161+
162+ WifiNetworkCollection *src = wc->createNetworkList();
163+ WifiNetworkCollection::iterator it;
164+ char buffer[256];
165+
166+ for(it = src->begin(); it != src->end(); ++it) {
167+ sprintf(buffer, "%d:%s", (*it)->getNetworkId(), (*it)->getSsid());
168+ cli->sendMsg(ErrorCode::WifiNetworkList, buffer, false);
169+ delete (*it);
170+ it = src->erase(it);
171+ }
172+
173+ delete src;
174+ cli->sendMsg(ErrorCode::CommandOkay, "Network listing complete.", false);
175+ return 0;
176+}
177+
178+CommandListener::WifiSetVarCmd::WifiSetVarCmd() :
179+ NexusCommand("wifi_setvar") {
180+}
181+
182+int CommandListener::WifiSetVarCmd::runCommand(SocketClient *cli, char *data) {
183+ WifiController *wc = (WifiController *) NetworkManager::Instance()->findController("WIFI");
184+
185+ char *bword;
186+ char *last;
187+ char varname[32];
188+ char val[250];
189+ int networkId;
190+
191+ if (!(bword = strtok_r(data, ":", &last)))
192+ goto out_inval;
193+
194+ networkId = atoi(bword);
195+
196+ if (!(bword = strtok_r(NULL, ":", &last)))
197+ goto out_inval;
198+
199+ strncpy(varname, bword, sizeof(varname));
200+
201+ if (!(bword = strtok_r(NULL, ":", &last)))
202+ goto out_inval;
203+
204+ strncpy(val, bword, sizeof(val));
205+
206+ LOGD("Network id %d, varname '%s', value '%s'", networkId, varname, val);
207+
208+ return 0;
209+
210+out_inval:
211+ errno = EINVAL;
212+ cli->sendMsg(ErrorCode::CommandParameterError, "Failed to set variable.", true);
213+ return 0;
214+}
215+
216+CommandListener::WifiGetVarCmd::WifiGetVarCmd() :
217+ NexusCommand("wifi_getvar") {
218+}
219+
220+int CommandListener::WifiGetVarCmd::runCommand(SocketClient *cli, char *data) {
221+ WifiController *wc = (WifiController *) NetworkManager::Instance()->findController("WIFI");
222+
223+ char *bword;
224+ char *last;
225+ char varname[32];
226+ int networkId;
227+
228+ if (!(bword = strtok_r(data, ":", &last)))
229+ goto out_inval;
230+
231+ networkId = atoi(bword);
232+
233+ if (!(bword = strtok_r(NULL, ":", &last)))
234+ goto out_inval;
235+
236+ strncpy(varname, bword, sizeof(varname));
237+
238+ LOGD("networkId = %d, varname '%s'", networkId, varname);
239+
240+ return 0;
241+out_inval:
242+ errno = EINVAL;
243+ cli->sendMsg(ErrorCode::CommandParameterError, "Failed to get variable.", true);
244+ return 0;
245+}
246+
117247 /* ------------
118248 * Vpn Commands
119249 * ------------ */
--- a/nexus/CommandListener.h
+++ b/nexus/CommandListener.h
@@ -53,6 +53,41 @@ private:
5353 int runCommand(SocketClient *c, char *data);
5454 };
5555
56+ class WifiAddNetworkCmd : public NexusCommand {
57+ public:
58+ WifiAddNetworkCmd();
59+ virtual ~WifiAddNetworkCmd() {}
60+ int runCommand(SocketClient *c, char *data);
61+ };
62+
63+ class WifiRemoveNetworkCmd : public NexusCommand {
64+ public:
65+ WifiRemoveNetworkCmd();
66+ virtual ~WifiRemoveNetworkCmd() {}
67+ int runCommand(SocketClient *c, char *data);
68+ };
69+
70+ class WifiListNetworksCmd : public NexusCommand {
71+ public:
72+ WifiListNetworksCmd();
73+ virtual ~WifiListNetworksCmd() {}
74+ int runCommand(SocketClient *c, char *data);
75+ };
76+
77+ class WifiSetVarCmd : public NexusCommand {
78+ public:
79+ WifiSetVarCmd();
80+ virtual ~WifiSetVarCmd() {}
81+ int runCommand(SocketClient *c, char *data);
82+ };
83+
84+ class WifiGetVarCmd : public NexusCommand {
85+ public:
86+ WifiGetVarCmd();
87+ virtual ~WifiGetVarCmd() {}
88+ int runCommand(SocketClient *c, char *data);
89+ };
90+
5691 class VpnEnableCmd : public NexusCommand {
5792 public:
5893 VpnEnableCmd();
--- a/nexus/ErrorCode.h
+++ b/nexus/ErrorCode.h
@@ -23,6 +23,9 @@ public:
2323 // before proceeding with a new command.
2424 static const int ActionInitiated = 100;
2525
26+ static const int WifiScanResult = 125;
27+ static const int WifiNetworkList = 126;
28+
2629 // 200 series - Requested action has been successfully completed
2730 static const int CommandOkay = 200;
2831
@@ -33,6 +36,7 @@ public:
3336 // 500 series - The command was not accepted and the requested
3437 // action did not take place.
3538 static const int CommandSyntaxError = 500;
39+ static const int CommandParameterError = 501;
3640
3741 // 600 series - Unsolicited broadcasts
3842 static const int UnsolicitedInformational = 600;
--- a/nexus/Supplicant.cpp
+++ b/nexus/Supplicant.cpp
@@ -229,7 +229,7 @@ int Supplicant::sendCommand(const char *cmd, char *reply, size_t *reply_len)
229229 return -1;
230230 }
231231
232-// LOGD("sendCommand(): -> '%s'", cmd);
232+ LOGD("sendCommand(): -> '%s'", cmd);
233233
234234 int rc;
235235 if ((rc = wpa_ctrl_request(mCtrl, cmd, strlen(cmd), reply, reply_len, NULL)) == -2) {
@@ -245,7 +245,7 @@ int Supplicant::sendCommand(const char *cmd, char *reply, size_t *reply_len)
245245 !strncmp(cmd, "SCAN_RESULTS", 12))
246246 reply[*reply_len] = '\0';
247247
248-// LOGD("sendCommand(): <- '%s'", reply);
248+ LOGD("sendCommand(): <- '%s'", reply);
249249 return 0;
250250 }
251251
@@ -355,7 +355,7 @@ int Supplicant::onScanResultsEvent(SupplicantEvent *evt) {
355355 mLatestScanResults->push_back(new ScanResult(linep));
356356
357357 char tmp[128];
358- sprintf(tmp, "%d scan results ready", mLatestScanResults->size());
358+ sprintf(tmp, "Scan results ready (%d)", mLatestScanResults->size());
359359 NetworkManager::Instance()->getBroadcaster()->
360360 sendBroadcast(ErrorCode::UnsolicitedInformational, tmp, false);
361361 pthread_mutex_unlock(&mLatestScanResultsLock);
@@ -412,6 +412,35 @@ ScanResultCollection *Supplicant::createLatestScanResults() {
412412 return d;
413413 }
414414
415+WifiNetworkCollection *Supplicant::createNetworkList() {
416+ WifiNetworkCollection *d = new WifiNetworkCollection();
417+ return d;
418+}
419+
420+int Supplicant::addNetwork() {
421+ char reply[32];
422+ size_t len = sizeof(reply) -1;
423+
424+ memset(reply, 0, sizeof(reply));
425+ if (sendCommand("ADD_NETWORK", reply, &len))
426+ return -1;
427+
428+ return atoi(reply);
429+}
430+
431+int Supplicant::removeNetwork(int networkId) {
432+ char req[64];
433+
434+ sprintf(req, "REMOVE_NETWORK %d", networkId);
435+ char reply[32];
436+ size_t len = sizeof(reply) -1;
437+ memset(reply, 0, sizeof(reply));
438+
439+ if (sendCommand(req, reply, &len))
440+ return -1;
441+ return 0;
442+}
443+
415444 int Supplicant::setupConfig() {
416445 char buf[2048];
417446 int srcfd, destfd;
--- a/nexus/Supplicant.h
+++ b/nexus/Supplicant.h
@@ -23,6 +23,7 @@ class SupplicantEvent;
2323 #include <pthread.h>
2424
2525 #include "ScanResult.h"
26+#include "WifiNetwork.h"
2627
2728 class Supplicant {
2829 private:
@@ -41,10 +42,13 @@ public:
4142 int start();
4243 int stop();
4344 bool isStarted();
44- int triggerScan(bool active);
4545
46+ int triggerScan(bool active);
4647 ScanResultCollection *createLatestScanResults();
47- WifiNetworkCollection *createWifiNetworkList();
48+
49+ int addNetwork();
50+ int removeNetwork(int networkId);
51+ WifiNetworkCollection *createNetworkList();
4852
4953
5054 int getState() { return mState; }
--- a/nexus/WifiController.cpp
+++ b/nexus/WifiController.cpp
@@ -23,7 +23,7 @@
2323 #include "WifiController.h"
2424 #include "WifiScanner.h"
2525 #include "NetworkManager.h"
26-#include "ErrorCode.h";
26+#include "ErrorCode.h"
2727
2828 WifiController::WifiController(char *modpath, char *modname, char *modargs) :
2929 Controller("WIFI") {
@@ -151,6 +151,19 @@ int WifiController::setScanMode(uint32_t mode) {
151151 return rc;
152152 }
153153
154+int WifiController::addNetwork() {
155+ return mSupplicant->addNetwork();
156+}
157+
158+int WifiController::removeNetwork(int networkId) {
159+ return mSupplicant->removeNetwork(networkId);
160+}
161+
154162 ScanResultCollection *WifiController::createScanResults() {
155163 return mSupplicant->createLatestScanResults();
156164 }
165+
166+// XXX: This should be a const list
167+WifiNetworkCollection *WifiController::createNetworkList() {
168+ return mSupplicant->createNetworkList();
169+}
--- a/nexus/WifiController.h
+++ b/nexus/WifiController.h
@@ -25,6 +25,7 @@ class Supplicant;
2525 class WifiScanner;
2626
2727 #include "ScanResult.h"
28+#include "WifiNetwork.h"
2829
2930 class WifiController : public Controller {
3031 public:
@@ -56,9 +57,13 @@ public:
5657 int enable();
5758 int disable();
5859
59- ScanResultCollection *createScanResults();
60+ int addNetwork();
61+ int removeNetwork(int networkId);
62+ WifiNetworkCollection *createNetworkList();
6063
61- int getType();
64+ int getScanMode() { return mCurrentScanMode; }
65+ int setScanMode(uint32_t mode);
66+ ScanResultCollection *createScanResults();
6267
6368 char *getModulePath() { return mModulePath; }
6469 char *getModuleName() { return mModuleName; }
@@ -66,9 +71,6 @@ public:
6671
6772 Supplicant *getSupplicant() { return mSupplicant; }
6873
69- int getScanMode() { return mCurrentScanMode; }
70- int setScanMode(uint32_t mode);
71-
7274 protected:
7375 virtual int powerUp() = 0;
7476 virtual int powerDown() = 0;
--- /dev/null
+++ b/nexus/WifiNetwork.cpp
@@ -0,0 +1,109 @@
1+/*
2+ * Copyright (C) 2008 The Android Open Source Project
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+#include <errno.h>
18+#include <string.h>
19+#include <sys/types.h>
20+
21+#include "WifiNetwork.h"
22+#include "Supplicant.h"
23+
24+WifiNetwork::WifiNetwork(Supplicant *suppl) {
25+ mSuppl = suppl;
26+ mNetid = -1;
27+ mSsid = NULL;
28+ mBssid = NULL;
29+ mPsk = NULL;
30+ memset(mWepKeys, 0, sizeof(mWepKeys));
31+ mDefaultKeyIndex = -1;
32+ mPriority = -1;
33+ mHiddenSsid = NULL;
34+ mAllowedKeyManagement = 0;
35+ mAllowedProtocols = 0;
36+ mAllowedAuthAlgorithms = 0;
37+ mAllowedPairwiseCiphers = 0;
38+ mAllowedGroupCiphers = 0;
39+}
40+
41+WifiNetwork::~WifiNetwork() {
42+ if (mSsid)
43+ free(mSsid);
44+ if (mBssid)
45+ free(mBssid);
46+ if (mPsk)
47+ free(mPsk);
48+ for (int i = 0; i < 4; i++) {
49+ if (mWepKeys[i])
50+ free(mWepKeys[i]);
51+ }
52+ if (mHiddenSsid)
53+ free(mHiddenSsid);
54+}
55+
56+int WifiNetwork::setSsid(char *ssid) {
57+ errno = ENOSYS;
58+ return -1;
59+}
60+
61+int WifiNetwork::setBssid(char *bssid) {
62+ errno = ENOSYS;
63+ return -1;
64+}
65+
66+int WifiNetwork::setPsk(char *psk) {
67+ errno = ENOSYS;
68+ return -1;
69+}
70+
71+int WifiNetwork::setWepKey(int idx, char *key) {
72+ errno = ENOSYS;
73+ return -1;
74+}
75+
76+int WifiNetwork::setDefaultKeyIndex(int idx) {
77+ errno = ENOSYS;
78+ return -1;
79+}
80+
81+int WifiNetwork::setPriority(int idx) {
82+ errno = ENOSYS;
83+ return -1;
84+}
85+
86+int WifiNetwork::setHiddenSsid(char *ssid) {
87+ errno = ENOSYS;
88+ return -1;
89+}
90+
91+int WifiNetwork::setAllowedKeyManagement(uint32_t mask) {
92+ errno = ENOSYS;
93+ return -1;
94+}
95+
96+int WifiNetwork::setAllowedProtocols(uint32_t mask) {
97+ errno = ENOSYS;
98+ return -1;
99+}
100+
101+int WifiNetwork::setAllowedPairwiseCiphers(uint32_t mask) {
102+ errno = ENOSYS;
103+ return -1;
104+}
105+
106+int WifiNetwork::setAllowedGroupCiphers(uint32_t mask) {
107+ errno = ENOSYS;
108+ return -1;
109+}
--- /dev/null
+++ b/nexus/WifiNetwork.h
@@ -0,0 +1,174 @@
1+/*
2+ * Copyright (C) 2008 The Android Open Source Project
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+#ifndef _WIFI_NETWORK_H
18+#define _WIFI_NETWORK_H
19+
20+#include <sys/types.h>
21+
22+#include "../../../frameworks/base/include/utils/List.h"
23+
24+class KeyManagementMask {
25+public:
26+ static const uint32_t NONE = 0;
27+ static const uint32_t WPA_PSK = 0x01;
28+ static const uint32_t WPA_EAP = 0x02;
29+ static const uint32_t IEEE8021X = 0x04;
30+ static const uint32_t ALL = WPA_PSK | WPA_EAP | IEEE8021X;
31+};
32+
33+class SecurityProtocolMask {
34+public:
35+ static const uint32_t WPA = 0x01;
36+ static const uint32_t RSN = 0x02;
37+};
38+
39+class AuthenticationAlgorithmMask {
40+public:
41+ static const uint32_t OPEN = 0x01;
42+ static const uint32_t SHARED = 0x02;
43+ static const uint32_t LEAP = 0x04;
44+};
45+
46+class PairwiseCipherMask {
47+public:
48+ static const uint32_t NONE = 0x00;
49+ static const uint32_t TKIP = 0x01;
50+ static const uint32_t CCMP = 0x02;
51+};
52+
53+class GroupCipherMask {
54+public:
55+ static const uint32_t WEP40 = 0x01;
56+ static const uint32_t WEP104 = 0x02;
57+ static const uint32_t TKIP = 0x04;
58+ static const uint32_t CCMP = 0x08;
59+};
60+
61+class Supplicant;
62+
63+class WifiNetwork {
64+ Supplicant *mSuppl;
65+
66+ /*
67+ * Unique network id - normally provided by supplicant
68+ */
69+ int mNetid;
70+
71+ /*
72+ * The networks' SSID. Can either be an ASCII string,
73+ * which must be enclosed in double quotation marks
74+ * (ie: "MyNetwork"), or a string of hex digits which
75+ * are not enclosed in quotes (ie: 01ab7893)
76+ */
77+ char *mSsid;
78+
79+ /*
80+ * When set, this entry should only be used
81+ * when associating with the AP having the specified
82+ * BSSID. The value is a string in the format of an
83+ * Ethernet MAC address
84+ */
85+ char *mBssid;
86+
87+ /*
88+ * Pre-shared key for use with WPA-PSK
89+ */
90+ char *mPsk;
91+
92+ /*
93+ * Up to four WEP keys. Either in ASCII string enclosed in
94+ * double quotes, or a string of hex digits
95+ */
96+ char *mWepKeys[4];
97+
98+ /*
99+ * Default WEP key index, ranging from 0 -> NUM_WEP_KEYS -1
100+ */
101+ int mDefaultKeyIndex;
102+
103+ /*
104+ * Priority determines the preference given to a network by
105+ * supplicant when choosing an access point with which
106+ * to associate
107+ */
108+ int mPriority;
109+
110+ /*
111+ * This is a network that does not broadcast it's SSID, so an
112+ * SSID-specific probe request must be used for scans.
113+ */
114+ char *mHiddenSsid;
115+
116+ /*
117+ * The set of key management protocols supported by this configuration.
118+ */
119+ uint32_t mAllowedKeyManagement;
120+
121+ /*
122+ * The set of security protocols supported by this configuration.
123+ */
124+ uint32_t mAllowedProtocols;
125+
126+ /*
127+ * The set of authentication protocols supported by this configuration.
128+ */
129+ uint32_t mAllowedAuthAlgorithms;
130+
131+ /*
132+ * The set of pairwise ciphers for WPA supported by this configuration.
133+ */
134+ uint32_t mAllowedPairwiseCiphers;
135+
136+ /*
137+ * The set of group ciphers for WPA supported by this configuration.
138+ */
139+ uint32_t mAllowedGroupCiphers;
140+
141+public:
142+ WifiNetwork(Supplicant *suppl);
143+ virtual ~WifiNetwork();
144+
145+ int getNetworkId() { return mNetid; }
146+ const char *getSsid() { return mSsid; }
147+ const char *getBssid() { return mBssid; }
148+ const char *getPsk() { return mPsk; }
149+ const char *getWepKey(int idx) { return mWepKeys[idx]; }
150+ int getDefaultKeyIndex() { return mDefaultKeyIndex; }
151+ int getPriority() { return mPriority; }
152+ const char *getHiddenSsid() { return mHiddenSsid; }
153+ uint32_t getAllowedKeyManagement() { return mAllowedKeyManagement; }
154+ uint32_t getAllowedProtocols() { return mAllowedProtocols; }
155+ uint32_t getAllowedAuthAlgorithms() { return mAllowedAuthAlgorithms; }
156+ uint32_t getAllowedPairwiseCiphers() { return mAllowedPairwiseCiphers; }
157+ uint32_t getAllowedGroupCiphers() { return mAllowedGroupCiphers; }
158+
159+ int setSsid(char *ssid);
160+ int setBssid(char *bssid);
161+ int setPsk(char *psk);
162+ int setWepKey(int idx, char *key);
163+ int setDefaultKeyIndex(int idx);
164+ int setPriority(int pri);
165+ int setHiddenSsid(char *ssid);
166+ int setAllowedKeyManagement(uint32_t mask);
167+ int setAllowedProtocols(uint32_t mask);
168+ int setAllowedPairwiseCiphers(uint32_t mask);
169+ int setAllowedGroupCiphers(uint32_t mask);
170+};
171+
172+typedef android::List<WifiNetwork *> WifiNetworkCollection;
173+
174+#endif