From patchwork Fri Nov 9 13:37:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1720501 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C30EADF264 for ; Fri, 9 Nov 2012 13:38:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753244Ab2KINir (ORCPT ); Fri, 9 Nov 2012 08:38:47 -0500 Received: from latitanza.investici.org ([82.94.249.234]:50559 "EHLO latitanza.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753149Ab2KINiq (ORCPT ); Fri, 9 Nov 2012 08:38:46 -0500 Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 4CD5511804A; Fri, 9 Nov 2012 13:38:44 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org 4CD5511804A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1352468324; bh=zi5AW8Ye6/IH/3DcLRca3QfqbQ0FS3nFRkhOkEWY5P0=; h=From:To:Cc:Subject:Date:Message-Id; b=KuuHOVIT8l69uQFceS4MN4nuD7Nm9vdeTMcpXe1Cw1q/UlPGTGDirTs7IdCZhwD1Q VjyfaYDMNx+And6SG5l89Fdbv3fIMUggm5KOHjywO+qLROs0IiWEo32mPZFBeXDJ8v 1ZaZPspdRtnS1at+M2dnlZ2BxqMmmm0NArSKNkco= From: Antonio Quartulli To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Antonio Quartulli Subject: [PATCH] iw: print the ssid when requesting device info Date: Fri, 9 Nov 2012 14:37:58 +0100 Message-Id: <1352468278-30931-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.8.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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])