Patchwork Add WPA_BSS_MASK_DELIM flag to BSS command

login
register
mail settings
Submitter Dmitry Shmidt
Date Feb. 27, 2013, 8:39 p.m.
Message ID <20130227204247.23C5014029C@ushik.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/223698/
State Superseded
Headers show

Comments

Dmitry Shmidt - Feb. 27, 2013, 8:39 p.m.
This flag will add ==== delimiter between to separate bss results

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
---
 src/common/wpa_ctrl.h       | 1 +
 wpa_supplicant/ctrl_iface.c | 7 +++++++
 2 files changed, 8 insertions(+)
Jouni Malinen - Feb. 27, 2013, 9:26 p.m.
On Wed, Feb 27, 2013 at 12:39:35PM -0800, Dmitry Shmidt wrote:
> This flag will add ==== delimiter between to separate bss results

Would it be possible for this to confuse existing users of the BSS
command? It could be safer to mask out WPA_BSS_MASK_DELIM from the
default mask value, i.e., only include this if the optional MASK
parameter is used.
Jouni Malinen - Feb. 27, 2013, 9:27 p.m.
On Wed, Feb 27, 2013 at 12:39:35PM -0800, Dmitry Shmidt wrote:
> This flag will add ==== delimiter between to separate bss results

Forgot from the previous email.. Do we need this for the case where
only a single BSS entry is being requested (e.g., "BSS <BSSID>")?
Dmitry Shmidt - Feb. 27, 2013, 9:29 p.m.
On Wed, Feb 27, 2013 at 1:27 PM, Jouni Malinen <j@w1.fi> wrote:
> On Wed, Feb 27, 2013 at 12:39:35PM -0800, Dmitry Shmidt wrote:
>> This flag will add ==== delimiter between to separate bss results
>
> Forgot from the previous email.. Do we need this for the case where
> only a single BSS entry is being requested (e.g., "BSS <BSSID>")?

No, we definitely need to remove it from default MASK. Let me fix a patch.

>
> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap

Patch

diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
index 46e8dc7..19faf4e 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
@@ -169,6 +169,7 @@  extern "C" {
 #define WPA_BSS_MASK_P2P_SCAN		BIT(14)
 #define WPA_BSS_MASK_INTERNETW		BIT(15)
 #define WPA_BSS_MASK_WIFI_DISPLAY	BIT(16)
+#define WPA_BSS_MASK_DELIM		BIT(17)
 
 
 /* wpa_supplicant/hostapd control interface access */
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 87467b8..65a769e 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -3225,6 +3225,13 @@  static int print_bss_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss,
 	}
 #endif /* CONFIG_INTERWORKING */
 
+	if (mask & WPA_BSS_MASK_DELIM) {
+		ret = os_snprintf(pos, end - pos, "====\n");
+		if (ret < 0 || ret >= end - pos)
+			return 0;
+		pos += ret;
+	}
+
 	return pos - buf;
 }