From patchwork Fri Mar 4 09:20:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 591847 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C996D1402A9 for ; Fri, 4 Mar 2016 20:21:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=tieto.com header.i=@tieto.com header.b=Pd4jVJAH; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ablvR-0001xu-FR; Fri, 04 Mar 2016 09:21:33 +0000 Received: from mail-lb0-x22d.google.com ([2a00:1450:4010:c04::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ablvH-0001mc-2h for hostap@lists.infradead.org; Fri, 04 Mar 2016 09:21:25 +0000 Received: by mail-lb0-x22d.google.com with SMTP id bc4so53969688lbc.2 for ; Fri, 04 Mar 2016 01:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P+RzyivKICmFGJUvKqdColp6wIsfTaF66gX/PVgPNP8=; b=Pd4jVJAH3nP/xwlDXQD0VRPHy1T+1XwFeRewoBi8ofTrrwprUKN0Lm5EzawrpHWIdr 3uoRg7j1LETjYOVAiyas2/mgKOpvrbRII5NLrPBupxZ9udmCjWDMI0HwZPPrYaa/quQO nAc42ysKV/JbFIRTvbAxoBnoS1AEiiK5ybiV4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=P+RzyivKICmFGJUvKqdColp6wIsfTaF66gX/PVgPNP8=; b=MiAANU6elfm07uNUxWynVmnzMBKVVrBdaiE69jMxc1wjPIjBGguJT2P1JkqQ8KrScy IdrQ0/LLKDrDSBQ6K/qk4/TwogIZ/ug0UN8GWqYVq48jhQgHF+t5En+wiJXd68tTshIm jHCdP1oX0dh/ty1PamPMMQHmpY7J/xoQlcfbqguHTvEjX2D/UHLwBZ2FiCby/S2Xie35 utt9iN7+FOWhHvOeADJ0H7fEDqg9+laGYHueJo0rf2OtGbGLlmEkMGcZKtV6tOEvH1xr /ZyjvPAprM+vStWpOk1XMI/QYIzimiIz75LZM1yInSKNqW5Pw5x1Ik5bTOjG9OkG0QGV lRrA== X-Gm-Message-State: AD7BkJK7q11iByR/b1/+8fLybJffMLj1gKB5Z3L5invNPzbkkT/7v6ymvuanY+88+KGu/8S16LI7GdWp6qUOiU2jM82BbXSDQc33VBvrvMN9ssrW+u7kNRNLEKq1mQPSfycKnuK1KRzlkpJFkDXROYy3k9r4TbV7MsBjMlrH4UtUQw0hlIqaiV94wYyRl50mbaNv X-Received: by 10.112.140.169 with SMTP id rh9mr2281956lbb.69.1457083263423; Fri, 04 Mar 2016 01:21:03 -0800 (PST) Received: from dell6430.guest.wifi ([91.198.246.8]) by smtp.gmail.com with ESMTPSA id r191sm437001lfe.28.2016.03.04.01.21.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Mar 2016 01:21:02 -0800 (PST) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH v5 11/25] wpa_supplicant: udp ctrl show when ITERFACES ctrl cmd Date: Fri, 4 Mar 2016 10:20:27 +0100 Message-Id: <1457083241-7492-12-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457083241-7492-1-git-send-email-janusz.dziedzic@tieto.com> References: <1457083241-7492-1-git-send-email-janusz.dziedzic@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160304_012123_521278_5E6B3196 X-CRM114-Status: GOOD ( 10.46 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c04:0:0:0:22d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: j@w1.fi, Janusz Dziedzic MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Show udp port when handle INTERFACES ctrl command. Signed-off-by: Janusz Dziedzic --- wpa_supplicant/ctrl_iface.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index f585b92..9bbe78a 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -55,6 +55,7 @@ static int wpa_supplicant_global_iface_list(struct wpa_global *global, char *buf, int len); static int wpa_supplicant_global_iface_interfaces(struct wpa_global *global, + const char *input, char *buf, int len); static int * freq_range_to_channel_list(struct wpa_supplicant *wpa_s, char *val); @@ -8842,9 +8843,9 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, } else if (os_strcmp(buf, "INTERFACE_LIST") == 0) { reply_len = wpa_supplicant_global_iface_list( wpa_s->global, reply, reply_size); - } else if (os_strcmp(buf, "INTERFACES") == 0) { + } else if (os_strncmp(buf, "INTERFACES", 10) == 0) { reply_len = wpa_supplicant_global_iface_interfaces( - wpa_s->global, reply, reply_size); + wpa_s->global, buf + 10, 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); @@ -9250,18 +9251,28 @@ static int wpa_supplicant_global_iface_list(struct wpa_global *global, static int wpa_supplicant_global_iface_interfaces(struct wpa_global *global, + const char *input, char *buf, int len) { int res; char *pos, *end; struct wpa_supplicant *wpa_s; + int show_ctrl = 0; + + if (input) + show_ctrl = !!os_strstr(input, "ctrl"); wpa_s = global->ifaces; pos = buf; end = buf + len; while (wpa_s) { - res = os_snprintf(pos, end - pos, "%s\n", wpa_s->ifname); + if (show_ctrl) + res = os_snprintf(pos, end - pos, "%s ctrl_iface=%s\n", + wpa_s->ifname, wpa_s->conf->ctrl_interface); + else + res = os_snprintf(pos, end - pos, "%s\n", wpa_s->ifname); + if (os_snprintf_error(end - pos, res)) { *pos = '\0'; break; @@ -9650,9 +9661,9 @@ char * wpa_supplicant_global_ctrl_iface_process(struct wpa_global *global, } else if (os_strcmp(buf, "INTERFACE_LIST") == 0) { reply_len = wpa_supplicant_global_iface_list( global, reply, reply_size); - } else if (os_strcmp(buf, "INTERFACES") == 0) { + } else if (os_strncmp(buf, "INTERFACES", 10) == 0) { reply_len = wpa_supplicant_global_iface_interfaces( - global, reply, reply_size); + global, buf + 10, reply, reply_size); #ifdef CONFIG_FST } else if (os_strncmp(buf, "FST-ATTACH ", 11) == 0) { reply_len = wpas_global_ctrl_iface_fst_attach(global, buf + 11,