From patchwork Mon Dec 19 06:33:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neeraj Garg X-Patchwork-Id: 132165 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id E5B27B7042 for ; Mon, 19 Dec 2011 17:34:29 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 576B29C14B; Mon, 19 Dec 2011 01:34:25 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HIhYBjPYrF8H; Mon, 19 Dec 2011 01:34:25 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 11C6F9C13A; Mon, 19 Dec 2011 01:34:21 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 165A89C13A for ; Mon, 19 Dec 2011 01:34:19 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mhaH+RiVJUzk for ; Mon, 19 Dec 2011 01:34:14 -0500 (EST) Received: from mms1.broadcom.com (mms1.broadcom.com [216.31.210.17]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 11A4E9C11F for ; Mon, 19 Dec 2011 01:34:13 -0500 (EST) Received: from [10.16.192.232] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Sun, 18 Dec 2011 22:42:35 -0800 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from SJEXCHCCR02.corp.ad.broadcom.com ([10.16.192.130]) by SJEXCHHUB02.corp.ad.broadcom.com ([10.16.192.232]) with mapi; Sun, 18 Dec 2011 22:34:01 -0800 From: "Neeraj Kumar Garg" To: "hostap@lists.shmoo.com" Date: Sun, 18 Dec 2011 22:33:50 -0800 Subject: Subject: [PATCH] Adding AP-STA-CONNECTED and DISCONNECTED events to wpa_cli if it is running with -a Thread-Topic: Subject: [PATCH] Adding AP-STA-CONNECTED and DISCONNECTED events to wpa_cli if it is running with -a Thread-Index: Acy+GCpr9A+a8RIIRESjubFRo2dQtw== Message-ID: <2C2F1EBA8050E74EA81502D5740B4BD6BBBCBAB63C@SJEXCHCCR02.corp.ad.broadcom.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-hashedpuzzle: AYQz Aq8Z CMqR DDak DHgO DI2u Dunz D9Ah EZx5 Eq+f E3yx FACf GF78 G4ce HZA8 IN4F; 1; aABvAHMAdABhAHAAQABsAGkAcwB0AHMALgBzAGgAbQBvAG8ALgBjAG8AbQA=; Sosha1_v1; 7; {55F3997F-EF73-4950-A53F-B14A35B9C74F}; bgBlAGUAcgBhAGoAawBnAEAAYgByAG8AYQBkAGMAbwBtAC4AYwBvAG0A; Mon, 19 Dec 2011 06:33:50 GMT; UwB1AGIAagBlAGMAdAA6ACAAWwBQAEEAVABDAEgAXQAgAEEAZABkAGkAbgBnACAAQQBQAC0AUwBUAEEALQBDAE8ATgBOAEUAQwBUAEUARAAgAGEAbgBkACAARABJAFMAQwBPAE4ATgBFAEMAVABFAEQAIABlAHYAZQBuAHQAcwAgAHQAbwAgAHcAcABhAF8AYwBsAGkAIABpAGYAIABpAHQAIABpAHMAIAByAHUAbgBuAGkAbgBnACAAdwBpAHQAaAAgAC0AYQA= x-cr-puzzleid: {55F3997F-EF73-4950-A53F-B14A35B9C74F} acceptlanguage: en-US MIME-Version: 1.0 X-WSS-ID: 62F003513DS7387951-01-01 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Hello, Is it possible to add events like AP-STA-CONNECTED and DISCONNECTED events to a running wpa_cli with -a option. This is needed purely for test purposes for automation. Plz let me know if below patch is OK. Subject: [PATCH] Adding AP-STA-CONNECTED and DISCONNECTED events to wpa_cli if it is running with -a Signed-hostap: Neeraj Kumar Garg --- wpa_supplicant/wpa_cli.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 42c81cd..6ca7939 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -3292,6 +3292,10 @@ static void wpa_cli_action_process(const char *msg) wpa_cli_exec(action_file, ctrl_ifname, pos); } else if (str_match(pos, WPS_EVENT_FAIL)) { wpa_cli_exec(action_file, ctrl_ifname, pos); + } else if (str_match(pos, AP_STA_CONNECTED)) { + wpa_cli_exec(action_file, ctrl_ifname, pos); + } else if (str_match(pos, AP_STA_DISCONNECTED)) { + wpa_cli_exec(action_file, ctrl_ifname, pos); } else if (str_match(pos, WPA_EVENT_TERMINATING)) { printf("wpa_supplicant is terminating - stop monitoring\n"); wpa_cli_quit = 1;