[pkg-wpa-devel] r1075 - in /wpasupplicant/trunk/debian: changelog patches/80_wpa_ctrl_scan_event.patch patches/81_ctrl_iface_scan_bss_command.patch patches/series

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


Author: kelmo-guest
Date: Wed Jan 30 12:26:18 2008
New Revision: 1075

URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1075
Log:
* Cherry pick upstream commits that adds scan event signal to clients
  listening to ctrl interface and an iterative (per bssid) scan result
  interface.
    - debian/patches/80_wpa_ctrl_scan_event.patch
    - debian/patches/81_ctrl_iface_scan_bss_command.patch

Added:
    wpasupplicant/trunk/debian/patches/80_wpa_ctrl_scan_event.patch
    wpasupplicant/trunk/debian/patches/81_ctrl_iface_scan_bss_command.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=1075&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/changelog (original)
+++ wpasupplicant/trunk/debian/changelog Wed Jan 30 12:26:18 2008
@@ -70,8 +70,13 @@
     events as they are added by calling scrollToBottom() function of listview
     object.
       - debian/patches/70_wpa_gui_qt4_wpagui_scroll_follow_eventhistory.patch
-
- -- Kel Modderman <kel at otaku42.de>  Wed, 30 Jan 2008 16:24:55 +1000
+  * Cherry pick upstream commits that adds scan event signal to clients
+    listening to ctrl interface and an iterative (per bssid) scan result
+    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
 
 wpasupplicant (0.6.2-1) experimental; urgency=low
 

Added: wpasupplicant/trunk/debian/patches/80_wpa_ctrl_scan_event.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/80_wpa_ctrl_scan_event.patch?rev=1075&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/80_wpa_ctrl_scan_event.patch (added)
+++ wpasupplicant/trunk/debian/patches/80_wpa_ctrl_scan_event.patch Wed Jan 30 12:26:18 2008
@@ -1,0 +1,33 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Wed, 30 Jan 2008 03:37:40 +0000 (-0800)
+Subject: Added CTRL-EVENT-SCAN-RESULTS event
+X-Git-Url: http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=a5d823e0872589f3f1633732f2fe8ad9c06b8b74
+
+Added CTRL-EVENT-SCAN-RESULTS event
+
+This event notifies ctrl_iface monitors of availability of new scan
+results.
+---
+
+--- a/src/common/wpa_ctrl.h
++++ b/src/common/wpa_ctrl.h
+@@ -46,6 +46,8 @@
+ #define WPA_EVENT_EAP_SUCCESS "CTRL-EVENT-EAP-SUCCESS "
+ /** EAP authentication failed (EAP-Failure received) */
+ #define WPA_EVENT_EAP_FAILURE "CTRL-EVENT-EAP-FAILURE "
++/** New scan results available */
++#define WPA_EVENT_SCAN_RESULTS "CTRL-EVENT-SCAN-RESULTS "
+ 
+ 
+ /* wpa_supplicant/hostapd control interface access */
+--- a/wpa_supplicant/events.c
++++ b/wpa_supplicant/events.c
+@@ -544,6 +544,8 @@
+ 		goto req_scan;
+ 	}
+ 
++	wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS);
++
+ 	wpa_supplicant_dbus_notify_scan_results(wpa_s);
+ 
+ 	if (wpa_s->conf->ap_scan == 2 || wpa_s->disconnected)

Added: wpasupplicant/trunk/debian/patches/81_ctrl_iface_scan_bss_command.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/81_ctrl_iface_scan_bss_command.patch?rev=1075&op=file
==============================================================================
--- wpasupplicant/trunk/debian/patches/81_ctrl_iface_scan_bss_command.patch (added)
+++ wpasupplicant/trunk/debian/patches/81_ctrl_iface_scan_bss_command.patch Wed Jan 30 12:26:18 2008
@@ -1,0 +1,169 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Wed, 30 Jan 2008 04:26:49 +0000 (-0800)
+Subject: Added ctrl_iface command for fetching scan results once BSS at a time
+X-Git-Url: http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=2e21d5604678012ca89f719a6daf7d8e379cf1d4
+
+Added ctrl_iface command for fetching scan results once BSS at a time
+
+Added new ctrl_iface command, BSS, to allow scan results to be fetched
+without hitting the message size limits (this command can be used to
+iterate through the scan results one BSS at the time).
+
+"BSS first" shows information for the first BSS in the scan results,
+"BSS <BSSID>" for the specified BSS, and "BSS next <BSSID>" for the BSS
+following the specified BSS (to allow iteration through the list).
+---
+
+--- a/wpa_supplicant/ctrl_iface.c
++++ b/wpa_supplicant/ctrl_iface.c
+@@ -1218,6 +1218,93 @@
+ }
+ 
+ 
++static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s,
++					 const char *cmd, char *buf,
++					 size_t buflen)
++{
++	u8 bssid[ETH_ALEN];
++	int next = 0;
++	int first = 0;
++	size_t i;
++	struct wpa_scan_results *results;
++	struct wpa_scan_res *bss;
++	int ret;
++	char *pos, *end;
++	const u8 *ie;
++
++	if (os_strcmp(cmd, "first") == 0) {
++		first = 1;
++	} else if (os_strncmp(cmd, "next ", 5) == 0) {
++		next = 1;
++		if (hwaddr_aton(cmd + 5, bssid))
++			return -1;
++	} else {
++		if (hwaddr_aton(cmd, bssid))
++			return -1;
++	}
++
++	results = wpa_s->scan_res;
++	if (results == NULL)
++		return 0;
++
++	for (i = 0; i < results->num; i++) {
++		if (first)
++			break;
++
++		if (os_memcmp(bssid, results->res[i]->bssid, ETH_ALEN) == 0) {
++			if (next)
++				first = 1; /* pick next */
++			else
++				break;
++		}
++	}
++
++	if (i >= results->num)
++		return 0; /* no match found */
++
++	bss = results->res[i];
++	pos = buf;
++	end = buf + buflen;
++	ret = snprintf(pos, end - pos,
++		       "bssid=" MACSTR "\n"
++		       "freq=%d\n"
++		       "beacon_int=%d\n"
++		       "capabilities=0x%04x\n"
++		       "qual=%d\n"
++		       "noise=%d\n"
++		       "level=%d\n"
++		       "tsf=%016llu\n"
++		       "ie=",
++		       MAC2STR(bss->bssid), bss->freq, bss->beacon_int,
++		       bss->caps, bss->qual, bss->noise, bss->level, bss->tsf);
++	if (ret < 0 || ret >= end - pos)
++		return pos - buf;
++	pos += ret;
++
++	ie = (const u8 *) (bss + 1);
++	for (i = 0; i < bss->ie_len; i++) {
++		ret = snprintf(pos, end - pos, "%02x", *ie++);
++		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]) : "");
++	if (ret < 0 || ret >= end - pos)
++		return pos - buf;
++	pos += ret;
++
++	return pos - buf;
++}
++
++
+ static int wpa_supplicant_ctrl_iface_ap_scan(
+ 	struct wpa_supplicant *wpa_s, char *cmd)
+ {
+@@ -1368,6 +1455,9 @@
+ 	} else if (os_strcmp(buf, "INTERFACES") == 0) {
+ 		reply_len = wpa_supplicant_global_iface_interfaces(
+ 			wpa_s->global, reply, reply_size);
++	} else if (os_strncmp(buf, "BSS ", 4) == 0) {
++		reply_len = wpa_supplicant_ctrl_iface_bss(
++			wpa_s, buf + 4, reply, reply_size);
+ 	} else {
+ 		os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
+ 		reply_len = 16;
+--- a/wpa_supplicant/wpa_cli.c
++++ b/wpa_supplicant/wpa_cli.c
+@@ -126,6 +126,7 @@
+ "disconnected\n"
+ "  scan = request new BSS scan\n"
+ "  scan_results = get latest scan results\n"
++"  bss <<first> | <bssid> | <next bssid>> = get detailed scan result info\n"
+ "  get_capability <eap/pairwise/group/key_mgmt/proto/auth_alg> = "
+ "get capabilies\n"
+ "  ap_scan <value> = set ap_scan parameter\n"
+@@ -894,6 +895,28 @@
+ }
+ 
+ 
++static int wpa_cli_cmd_bss(struct wpa_ctrl *ctrl, int argc, char *argv[])
++{
++	char cmd[64];
++	int res;
++
++	if (argc < 1 || argc > 2) {
++		printf("Invalid BSS command: need either one or two "
++		       "arguments\n");
++		return -1;
++	}
++
++	res = os_snprintf(cmd, sizeof(cmd), "BSS %s%s%s", argv[0],
++			  (argc == 2) ? " " : "",
++			  (argc == 2) ? argv[1] : "");
++	if (res < 0 || (size_t) res >= sizeof(cmd))
++		return -1;
++	cmd[sizeof(cmd) - 1] = '\0';
++
++	return wpa_ctrl_command(ctrl, cmd);
++}
++
++
+ static int wpa_cli_cmd_get_capability(struct wpa_ctrl *ctrl, int argc,
+ 				      char *argv[])
+ {
+@@ -1061,6 +1084,7 @@
+ 	{ "reconnect", wpa_cli_cmd_reconnect },
+ 	{ "scan", wpa_cli_cmd_scan },
+ 	{ "scan_results", wpa_cli_cmd_scan_results },
++	{ "bss", wpa_cli_cmd_bss },
+ 	{ "get_capability", wpa_cli_cmd_get_capability },
+ 	{ "reconfigure", wpa_cli_cmd_reconfigure },
+ 	{ "terminate", wpa_cli_cmd_terminate },

Modified: wpasupplicant/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/patches/series?rev=1075&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/patches/series (original)
+++ wpasupplicant/trunk/debian/patches/series Wed Jan 30 12:26:18 2008
@@ -41,3 +41,5 @@
 64_wpa_gui_qt4_wpagui_info_no_network.patch
 70_wpa_gui_qt4_wpagui_scroll_follow_eventhistory.patch
 71_wpa_gui_qt4_wpagui_wep_enabled_from_scan.patch
+80_wpa_ctrl_scan_event.patch
+81_ctrl_iface_scan_bss_command.patch




More information about the Pkg-wpa-devel mailing list