Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2838144lqp; Mon, 25 Mar 2024 10:34:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZAHx6EH8Lp7RyNcD9k4aM1Ebf9yiGfuZ6kIvPxKU32PX5NAeuMTEieAX+piyC4uRK2kaUEQkRvRbXbqmu7/OT6SIGalKGVNQGXlTtpQ== X-Google-Smtp-Source: AGHT+IGFkTHzqHB9XDken10RzYMkCwGEBAbgX73i++NW+0MAU3gtfZU6qlFhjN6okARaZy7ZLLvT X-Received: by 2002:a25:16c3:0:b0:dd1:7a2c:95c3 with SMTP id 186-20020a2516c3000000b00dd17a2c95c3mr5846582ybw.36.1711388082136; Mon, 25 Mar 2024 10:34:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711388082; cv=pass; d=google.com; s=arc-20160816; b=nXvVmMas2q7tluZ8wUwgL+rUE1wSxigepToGrUHx/DcnZx48txcrLYFR0KVuz9O6Fo UNroqTaGGJeggfgVEs+vbrt+7kcOvRameQgHjuk6MQquno6QgJp53MfXJMPpkAd6xHBQ k+sDgsMPeBzg04IYKdZzeehtqnXqmNI2tvA66OReFNPvffALsstsIpB4SwH/onE3AzaY HOxNBYFSIkGsFS8/ygxf8Z3jj9Jo1Y9znGuj3kd3IhHzGCBzV3wP2ENzQBopjbdctStl OBA6KQBzpkoHimXo86mJL1/ZEQgfUEXDkt68n7mW5aXH+FyLLx0mv3GsTYFhifExXbXI si1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:to :from:subject:message-id:dkim-signature; bh=C4JkLaPzy+FHNYkjByuPk97Bb325dxvMetJZG1ECmpo=; fh=PtUkoN/+v44m91maJrMpMjTWasXqGdTKWVm0ltWP9DQ=; b=FsTz7kzoc77fnQbhqYOSFcQTfM2yKYW/XEyYQSOo7+pVR4LqKd9foOhe3VBpo3WpAK drT3pgAtO1NJ3WlWKAG0qZIFgeMIJvWtyjs2AaumEIeKTtRRVZDD+mvSArV5C3Dhz/ZA oqDrAWf9uNgxoChxksZR7Q+Hai+RzLBGSHT4MJGnxlza8q6D/hfLszBFQEkxbR6QfNQT /UP9MZUvf7c2JpYR/PgB1N8P8JtOolbxeAHf0EMFyzq/MmkDTfgVAphtu2ePgS9Wu3Il hnyTmqqskYSq1LUIusHm2mBbZE76OdqgSKgDaqxcdIusvemp3UtAWL4Vp8u5nfuXKSTh 8IKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="QuZ/olKr"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-5222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jn10-20020ad45dea000000b006968b6c20b5si2868755qvb.356.2024.03.25.10.34.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 10:34:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="QuZ/olKr"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-5222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B1F7B1C39B6D for ; Mon, 25 Mar 2024 17:34:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48D33146A7D; Mon, 25 Mar 2024 16:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="QuZ/olKr" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B81F84047 for ; Mon, 25 Mar 2024 16:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711384382; cv=none; b=CTz8fXYTTig2vAi4Xaib3zApYO2fAiB4pZxPMzvWx7fgyn46ZGB0KcyD0v5wcYRTV1RFt1mU2h/ssnFWAoeiXxF9JYwkywzL/61wx+v6kZTUqW8iFW4qvHVODaRZ4tpubVi/eI8xMLl4uhwvVAzilqXzZT2hzo7orRbK4e/xQjw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711384382; c=relaxed/simple; bh=gGjXkXJdYs7YTScboi+CHwojUWcX1kNCosLPke24bBM=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References: Content-Type:MIME-Version; b=bavBoC4WreSZJ4Hu0Ggl9LlN165a89Q1ptwyroihvZU7qR9sRiDPxEWwt//R+i8fHjCzq92qX1VUMPftPGS9k9bzUz8jgEihgO2ckgGc1vsw3ofIycKIE3ZbBdBqLyNKOhiwJ4KeWC57BHolYXZ7uEZJgD4P0w+LNueLlhtkBN0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=QuZ/olKr; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:To:From:Subject:Message-ID:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=C4JkLaPzy+FHNYkjByuPk97Bb325dxvMetJZG1ECmpo=; t=1711384380; x=1712593980; b=QuZ/olKrixp9ISGWYrUOpzxw3Z8etI/Scc+8NhY5j913clu d6GQY+lfBE2Hd3Lif0AQOhLLQCVT1aqrL814ERwciVg57U814u+15f0vn6gCpYE27ZPjycNxn+oBe hjZSFCNfxTDWtghjBUHsojVJOR7kNTByO54fY1ArvypnbH1e5PaldSSG4eDbq4jGjmA6wxusICYtY ARykyGTZSjh7OdZhnW+VHiAXgKSFiN5AhboMvHXPEQmLkcfuoDslzajFsmVAss7q20EH67lIyVMgG Q9NVx+hWIS/FYUqbIKuFwYZtu1xC+QQnkZb9YQ61p4/5xKxZ53Mbs+sqMLK3PHLg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1ronFk-0000000Dx5A-2jqM; Mon, 25 Mar 2024 17:32:52 +0100 Message-ID: Subject: Re: [PATCH v12] Add JSON output options to 'iw' for scan results From: Johannes Berg To: Isaev Ruslan , linux-wireless@vger.kernel.org Date: Mon, 25 Mar 2024 17:32:51 +0100 In-Reply-To: <206d1b47b7ece7ccd1c371d23ae1f1c6.legale.legale@gmail.com> References: <206d1b47b7ece7ccd1c371d23ae1f1c6.legale.legale@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned Hmm. Honestly, this output is awful. I can kind of understand where that's coming from (the desire to have an object created for each element in the frame, but ...) >=20 > TSF: > usec: 321559832898 > dd: 3 > hh: 17 > mm: 19 > ss: 19 Really? We used to print this as TSF: 0 usec (0d, 00:00:00) (not sure why all zeroes here but anyway) > Frequency: 5180 > Beacon Interval, TUs: 100 > Capability: > ESS > Privacy > ShortPreamble > Capability Raw Value: 0x0031 capability: ESS Privacy SpectrumMgmt RadioMeasure (0x1111) > Signal: -72.00 dBm > Last Seen Ago, ms: 2740 > BSS Probe Response Data Frame: > SSID: > SSID: tobe52 That's just silly. > Supported rates: > Rates: > 6.0* > 9.0 > 12.0* > 18.0 > 24.0* > 36.0 > 48.0 > 54.0 Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0=20 And that stuff is a really pointless output in JSON, for JSON it'd be much more useful to output an object with actual (integer) values, and a flag to indicate 'basic', or something. Anyway ... I think you're hyper-focused on exactly the wrong thing. Arguably, for scan results, the right thing to do would be to just output the raw elements in the JSON, and not do any of this parsing. Then you can use your favourite parsing library (dpkt? tshark? ...) to actually understand the data there. We really don't need to expose the element parsing logic of iw, especially not in a bad way like this. Also, outputting the *string* data in a machine-readable format like you do now has very little value, and yet it ties us to a specific output format that we'd probably have to consider stable. Bad idea. So I guess I'm saying yhou should abandon this line of changes in this code entirely. Much more interesting, IMHO, would be to focus in pretty much anything _else_ in the iw code, e.g. the output of 'iw dev', 'iw wlan0 info', statistics, etc. Maybe 'iw list' and similar too. Although I suspect that what we really need is better access for tools from nl80211. Maybe the "JSON" output format should just dump the raw nl80211 message attributes that are involved, or something. johannes