[pkg-wpa-devel] r1076 - in /wpasupplicant/trunk/debian: changelog patches/83_ctrl_iface_scan_bss_flags.patch patches/90_wpa_gui_qt4_update_scan_results_on_event.patch patches/91_wpa_gui_qt4_scanres_bss_iterative.patch patches/series

kelmo-guest at users.alioth.debian.org kelmo-guest at users.alioth.debian.org
Wed Jan 30 18:09:54 UTC 2008


Author: kelmo-guest
Date: Wed Jan 30 18:09:53 2008
New Revision: 1076

URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1076
Log:
* Add flags to new bss ctrl interface command output.
    - debian/patches/83_ctrl_iface_scan_bss_flags.patch
* Use iterative scan result method to display scan results in wpa_gui. No
  longer use a QTimer for polling, the scan results will be updated on each
  CTRL-EVENT-SCAN-RESULTS.
    - debian/patches/90_wpa_gui_qt4_update_scan_results_on_event.patch
    - debian/patches/91_wpa_gui_qt4_scanres_bss_iterative.patch

Added:
    wpasupplicant/trunk/debian/patches/83_ctrl_iface_scan_bss_flags.patch
    wpasupplicant/trunk/debian/patches/90_wpa_gui_qt4_update_scan_results_on_event.patch
    wpasupplicant/trunk/debian/patches/91_wpa_gui_qt4_scanres_bss_iterative.patch
Modified:
    wpasupplicant/trunk/debian/changelog
    wpasupplicant/trunk/debian/patches/series

Modified: wpasupplicant/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/changelog?rev=1076&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/changelog (original)
+++ wpasupplicant/trunk/debian/changelog Wed Jan 30 18:09:53 2008
@@ -75,8 +75,15 @@
     interface.
       - debian/patches/80_wpa_ctrl_scan_event.patch
       - debian/patches/81_ctrl_iface_scan_bss_command.patch
-
- -- Kel Modderman <kel at otaku42.de>  Wed, 30 Jan 2008 22:23:38 +1000
+  * Add flags to new bss ctrl interface command output.
+      - debian/patches/83_ctrl_iface_scan_bss_flags.patch
+  * Use iterative scan result method to display scan results in wpa_gui. No
+    longer use a QTimer for polling, the scan results will be updated on each
+    CTRL-EVENT-SCAN-RESULTS.
+      - debian/patches/90_wpa_gui_qt4_update_scan_results_on_event.patch
+      - debian/patches/91_wpa_gui_qt4_scanres_bss_iterative.patch
+
+ -- Kel Modderman <kel at otaku42.de>  Thu, 31 Jan 2008 04:03:31 +1000
 
 wpasupplicant (0.6.2-1) experimental; urgency=low
 

Added: wpasupplicant/trunk/debian/patches/83_ctrl_iface_scan_bss_flags.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/83_ctrl_iface_scan_bss_flags.patch?rev=1076&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/83_ctrl_iface_scan_bss_flags.patch (added)
+++ wpasupplicant/trunk/debian/patches/83_ctrl_iface_scan_bss_flags.patch Wed Jan 30 18:09:53 2008
@@ -1,0 +1,47 @@
+--- a/wpa_supplicant/ctrl_iface.c
++++ b/wpa_supplicant/ctrl_iface.c
+@@ -1230,7 +1230,7 @@
+ 	struct wpa_scan_res *bss;
+ 	int ret;
+ 	char *pos, *end;
+-	const u8 *ie;
++	const u8 *ie, *ie2;
+ 
+ 	if (os_strcmp(cmd, "first") == 0) {
+ 		first = 1;
+@@ -1294,6 +1294,35 @@
+ 		return pos - buf;
+ 	pos += ret;
+ 
++	ret = os_snprintf(pos, end - pos, "flags=");
++	if (ret < 0 || ret >= end - pos)
++		return pos - buf;
++	pos += ret;
++
++	ie = wpa_scan_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE);
++	if (ie)
++		pos = wpa_supplicant_ie_txt(pos, end, "WPA", ie, 2 + ie[1]);
++	ie2 = wpa_scan_get_ie(bss, WLAN_EID_RSN);
++	if (ie2)
++		pos = wpa_supplicant_ie_txt(pos, end, "WPA2", ie2, 2 + ie2[1]);
++	if (!ie && !ie2 && bss->caps & IEEE80211_CAP_PRIVACY) {
++		ret = os_snprintf(pos, end - pos, "[WEP]");
++		if (ret < 0 || ret >= end - pos)
++			return pos - buf;
++		pos += ret;
++	}
++	if (bss->caps & IEEE80211_CAP_IBSS) {
++		ret = os_snprintf(pos, end - pos, "[IBSS]");
++		if (ret < 0 || ret >= end - pos)
++			return pos - buf;
++		pos += ret;
++	}
++
++	ret = snprintf(pos, end - pos, "\n");
++	if (ret < 0 || ret >= end - pos)
++		return pos - buf;
++	pos += ret;
++
+ 	ie = wpa_scan_get_ie(bss, WLAN_EID_SSID);
+ 	ret = os_snprintf(pos, end - pos, "ssid=%s\n",
+ 			  ie ? wpa_ssid_txt(ie + 2, ie[1]) : "");

Added: wpasupplicant/trunk/debian/patches/90_wpa_gui_qt4_update_scan_results_on_event.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/90_wpa_gui_qt4_update_scan_results_on_event.patch?rev=1076&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/90_wpa_gui_qt4_update_scan_results_on_event.patch (added)
+++ wpasupplicant/trunk/debian/patches/90_wpa_gui_qt4_update_scan_results_on_event.patch Wed Jan 30 18:09:53 2008
@@ -1,0 +1,43 @@
+--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
++++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+@@ -708,6 +708,8 @@
+ 
+ 	if (str_match(pos, WPA_CTRL_REQ))
+ 		processCtrlReq(pos + strlen(WPA_CTRL_REQ));
++	else if (str_match(pos, WPA_EVENT_SCAN_RESULTS) && scanres)
++		scanres->updateResults();
+ }
+ 
+ 
+--- a/wpa_supplicant/wpa_gui-qt4/scanresults.cpp
++++ b/wpa_supplicant/wpa_gui-qt4/scanresults.cpp
+@@ -38,7 +38,6 @@
+ 
+ ScanResults::~ScanResults()
+ {
+-	delete timer;
+ }
+ 
+ 
+@@ -52,11 +51,6 @@
+ {
+ 	wpagui = _wpagui;
+ 	updateResults();
+-    
+-	timer = new QTimer(this);
+-	connect(timer, SIGNAL(timeout()), SLOT(getResults()));
+-	timer->setSingleShot(FALSE);
+-	timer->start(10000);
+ }
+ 
+ 
+--- a/wpa_supplicant/wpa_gui-qt4/scanresults.h
++++ b/wpa_supplicant/wpa_gui-qt4/scanresults.h
+@@ -41,7 +41,6 @@
+ 
+ private:
+ 	WpaGui *wpagui;
+-	QTimer *timer;
+ };
+ 
+ #endif /* SCANRESULTS_H */

Added: wpasupplicant/trunk/debian/patches/91_wpa_gui_qt4_scanres_bss_iterative.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/91_wpa_gui_qt4_scanres_bss_iterative.patch?rev=1076&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/91_wpa_gui_qt4_scanres_bss_iterative.patch (added)
+++ wpasupplicant/trunk/debian/patches/91_wpa_gui_qt4_scanres_bss_iterative.patch Wed Jan 30 18:09:53 2008
@@ -1,0 +1,83 @@
+--- a/wpa_supplicant/wpa_gui-qt4/scanresults.cpp
++++ b/wpa_supplicant/wpa_gui-qt4/scanresults.cpp
+@@ -56,36 +56,43 @@
+ 
+ void ScanResults::updateResults()
+ {
+-	char reply[8192];
++	char reply[2048];
+ 	size_t reply_len;
+     
+-	if (wpagui == NULL)
+-		return;
+-
+-	reply_len = sizeof(reply) - 1;
+-	if (wpagui->ctrlRequest("SCAN_RESULTS", reply, &reply_len) < 0)
+-		return;
+-	reply[reply_len] = '\0';
+-
+ 	scanResultsWidget->clear();
++	QString cmd("BSS first");
+ 
+-	QString res(reply);
+-	QStringList lines = res.split(QChar('\n'));
+-	bool first = true;
+-	for (QStringList::Iterator it = lines.begin(); it != lines.end(); it++)
+-	{
+-		if (first) {
+-			first = false;
+-			continue;
+-		}
++	while (wpagui) {
++		reply_len = sizeof(reply) - 1;
++		if (wpagui->ctrlRequest(cmd.toAscii().constData(), reply,
++		    &reply_len) < 0)
++			break;
++		reply[reply_len] = '\0';
++
++		QString bss(reply);
++		if (bss.isEmpty() || bss.startsWith("FAIL"))
++			break;
+ 
+-		QStringList cols = (*it).split(QChar('\t'));
+ 		QString ssid, bssid, freq, signal, flags;
+-		bssid = cols.count() > 0 ? cols[0] : "";
+-		freq = cols.count() > 1 ? cols[1] : "";
+-		signal = cols.count() > 2 ? cols[2] : "";
+-		flags = cols.count() > 3 ? cols[3] : "";
+-		ssid = cols.count() > 4 ? cols[4] : "";
++
++		QStringList lines = bss.split(QRegExp("\\n"));
++		for (QStringList::Iterator it = lines.begin();
++		     it != lines.end(); it++) {
++			int pos = (*it).indexOf('=') + 1;
++			if (!pos)
++				continue;
++
++			if ((*it).startsWith("bssid="))
++				bssid = (*it).mid(pos);
++			else if ((*it).startsWith("freq="))
++				freq = (*it).mid(pos);
++			else if ((*it).startsWith("qual="))
++				signal = (*it).mid(pos);
++			else if ((*it).startsWith("flags="))
++				flags = (*it).mid(pos);
++			else if ((*it).startsWith("ssid="))
++				ssid = (*it).mid(pos);
++		}
+ 
+ 		QTreeWidgetItem *item = new QTreeWidgetItem(scanResultsWidget);
+ 		if (item) {
+@@ -95,6 +102,12 @@
+ 			item->setText(3, signal);
+ 			item->setText(4, flags);
+ 		}
++
++		if (bssid.isEmpty())
++			break;
++
++		cmd = "BSS next ";
++		cmd.append(bssid);
+ 	}
+ }
+ 

Modified: wpasupplicant/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/series?rev=1076&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/patches/series (original)
+++ wpasupplicant/trunk/debian/patches/series Wed Jan 30 18:09:53 2008
@@ -43,3 +43,6 @@
 71_wpa_gui_qt4_wpagui_wep_enabled_from_scan.patch
 80_wpa_ctrl_scan_event.patch
 81_ctrl_iface_scan_bss_command.patch
+83_ctrl_iface_scan_bss_flags.patch
+90_wpa_gui_qt4_update_scan_results_on_event.patch
+91_wpa_gui_qt4_scanres_bss_iterative.patch




More information about the Pkg-wpa-devel mailing list