All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iw: print the ssid when requesting device info
@ 2012-11-09 13:37 Antonio Quartulli
  2012-11-09 15:48 ` Johannes Berg
  2012-11-09 18:46 ` [PATCHv2] " Antonio Quartulli
  0 siblings, 2 replies; 6+ messages in thread
From: Antonio Quartulli @ 2012-11-09 13:37 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli

The GET_INTERFACE command receives also the ssid as part of the reply.
This patch makes iw print the ssid together with the other information
when issuing the "iw dev $vif info" command.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 interface.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/interface.c b/interface.c
index 810c2b9..a1e2861 100644
--- a/interface.c
+++ b/interface.c
@@ -294,6 +294,13 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
 		mac_addr_n2a(mac_addr, nla_data(tb_msg[NL80211_ATTR_MAC]));
 		printf("%s\taddr %s\n", indent, mac_addr);
 	}
+	if (tb_msg[NL80211_ATTR_SSID]) {
+		char ssid[33];
+		memcpy(ssid, nla_data(tb_msg[NL80211_ATTR_SSID]),
+		       nla_len(tb_msg[NL80211_ATTR_SSID]));
+		ssid[nla_len(tb_msg[NL80211_ATTR_SSID])] = '\0';
+		printf("%s\tssid %s\n", indent, ssid);
+	}
 	if (tb_msg[NL80211_ATTR_IFTYPE])
 		printf("%s\ttype %s\n", indent, iftype_name(nla_get_u32(tb_msg[NL80211_ATTR_IFTYPE])));
 	if (!wiphy && tb_msg[NL80211_ATTR_WIPHY])
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] iw: print the ssid when requesting device info
  2012-11-09 13:37 [PATCH] iw: print the ssid when requesting device info Antonio Quartulli
@ 2012-11-09 15:48 ` Johannes Berg
  2012-11-09 15:50   ` Johannes Berg
  2012-11-09 18:46 ` [PATCHv2] " Antonio Quartulli
  1 sibling, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2012-11-09 15:48 UTC (permalink / raw)
  To: Antonio Quartulli; +Cc: linux-wireless

On Fri, 2012-11-09 at 14:37 +0100, Antonio Quartulli wrote:
> The GET_INTERFACE command receives also the ssid as part of the reply.
> This patch makes iw print the ssid together with the other information
> when issuing the "iw dev $vif info" command.

Applied.

johannes


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iw: print the ssid when requesting device info
  2012-11-09 15:48 ` Johannes Berg
@ 2012-11-09 15:50   ` Johannes Berg
  2012-11-09 15:52     ` Antonio Quartulli
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2012-11-09 15:50 UTC (permalink / raw)
  To: Antonio Quartulli; +Cc: linux-wireless

On Fri, 2012-11-09 at 16:48 +0100, Johannes Berg wrote:
> On Fri, 2012-11-09 at 14:37 +0100, Antonio Quartulli wrote:
> > The GET_INTERFACE command receives also the ssid as part of the reply.
> > This patch makes iw print the ssid together with the other information
> > when issuing the "iw dev $vif info" command.
> 
> Applied.

Huh, no, I take that back. What are you doing, printing an SSID as
though it was a string?!

There's print_ssid_escaped() for a reason.

johannes


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iw: print the ssid when requesting device info
  2012-11-09 15:50   ` Johannes Berg
@ 2012-11-09 15:52     ` Antonio Quartulli
  0 siblings, 0 replies; 6+ messages in thread
From: Antonio Quartulli @ 2012-11-09 15:52 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

On Fri, Nov 09, 2012 at 04:50:39PM +0100, Johannes Berg wrote:
> On Fri, 2012-11-09 at 16:48 +0100, Johannes Berg wrote:
> > On Fri, 2012-11-09 at 14:37 +0100, Antonio Quartulli wrote:
> > > The GET_INTERFACE command receives also the ssid as part of the reply.
> > > This patch makes iw print the ssid together with the other information
> > > when issuing the "iw dev $vif info" command.
> > 
> > Applied.
> 
> Huh, no, I take that back. What are you doing, printing an SSID as
> though it was a string?!
> 

Uhm, right. I assumed it was composed by ASCII chars only.

> There's print_ssid_escaped() for a reason.

Thanks. Will use it.

Cheers,

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCHv2] iw: print the ssid when requesting device info
  2012-11-09 13:37 [PATCH] iw: print the ssid when requesting device info Antonio Quartulli
  2012-11-09 15:48 ` Johannes Berg
@ 2012-11-09 18:46 ` Antonio Quartulli
  2012-11-09 19:20   ` Johannes Berg
  1 sibling, 1 reply; 6+ messages in thread
From: Antonio Quartulli @ 2012-11-09 18:46 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli

The GET_INTERFACE command receives also the ssid as part of the reply.
This patch makes iw print the ssid together with the other information
when issuing the "iw dev $vif info" command.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
v2:
 - use print_ssid_escaped()


 interface.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/interface.c b/interface.c
index 810c2b9..28626dc 100644
--- a/interface.c
+++ b/interface.c
@@ -294,6 +294,12 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
 		mac_addr_n2a(mac_addr, nla_data(tb_msg[NL80211_ATTR_MAC]));
 		printf("%s\taddr %s\n", indent, mac_addr);
 	}
+	if (tb_msg[NL80211_ATTR_SSID]) {
+		printf("%s\tssid ", indent);
+		print_ssid_escaped(nla_len(tb_msg[NL80211_ATTR_SSID]),
+				   nla_data(tb_msg[NL80211_ATTR_SSID]));
+		printf("\n");
+	}
 	if (tb_msg[NL80211_ATTR_IFTYPE])
 		printf("%s\ttype %s\n", indent, iftype_name(nla_get_u32(tb_msg[NL80211_ATTR_IFTYPE])));
 	if (!wiphy && tb_msg[NL80211_ATTR_WIPHY])
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCHv2] iw: print the ssid when requesting device info
  2012-11-09 18:46 ` [PATCHv2] " Antonio Quartulli
@ 2012-11-09 19:20   ` Johannes Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2012-11-09 19:20 UTC (permalink / raw)
  To: Antonio Quartulli; +Cc: linux-wireless

On Fri, 2012-11-09 at 19:46 +0100, Antonio Quartulli wrote:
> The GET_INTERFACE command receives also the ssid as part of the reply.
> This patch makes iw print the ssid together with the other information
> when issuing the "iw dev $vif info" command.

Applied.

johannes


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-09 19:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-09 13:37 [PATCH] iw: print the ssid when requesting device info Antonio Quartulli
2012-11-09 15:48 ` Johannes Berg
2012-11-09 15:50   ` Johannes Berg
2012-11-09 15:52     ` Antonio Quartulli
2012-11-09 18:46 ` [PATCHv2] " Antonio Quartulli
2012-11-09 19:20   ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.