Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp426486pxv; Thu, 22 Jul 2021 03:43:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7x5XZsmCy1Yh7OZcGucEYEKzsP+hk8T5g5cmX8S5LKkYe53DXUWC2wdk/HuLih5Sgie/k X-Received: by 2002:a17:906:8558:: with SMTP id h24mr43134034ejy.519.1626950600693; Thu, 22 Jul 2021 03:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626950600; cv=none; d=google.com; s=arc-20160816; b=GqK3FvbxawjYkc7dt2B02eKw4KPaekFU4bAyqTlZZ55nj3XhgkF/dtpvkj5d3k6SPE h6qy50oEbvS1RFhrQlqfG5OvUu1BxoAaeFduYywhzDDtVUTqhepJ31ZqOjaRJNeDd8zZ 3mfzVrj6OeVPeGKjwimWZOYlugMhgso8DM6PhsBk2LpkqvQtnPHixOmVrD566FM22hQJ geJLYeWseQ6fhBXSdRWZWiGGnv5RuHlfwTNStpbhlcCirhbW73Y7RsACuGLuiBAoPXf4 S++H2B8GTJ4orEefTWBbDrHQ0t/QqOEWNaYvx+GAZE9sZwKcrE7fhi7Mp5nAza5xX7Av P+Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:reply-to:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=hjjYYUQIehI9VeBc6wX+U/RUbbsWqT6Tuj+xVmXLLJs=; b=QoySIPPTkag0eOrv+lSYwGr+oAizrvfzcpCA5xU8zqvL/vys0m+iu8MVpg1QX3ZEtu BqhUTmMJ2/IyIDwKQlnO8ZbST8MuCFqMez5uFYiR2ga0pB4h4QZGbCvBp8cbCBdKYFD3 hI/nIRZ5Vq39EzlqaL8TrveBFWwTRfxsSet0CnnL5TnzWotNSH8N5DWHmbQnaxvh2vm8 O4XLW5TFUU51qOlj5AVSjDj5TceDBqA8md9QoVMq3YNfSCmp23IKch6HEVRmGm5IEJ0d TnThJQhz9ebswmJJY61Jg2WzrlvzgsqNLAhwRckkapHWGE9ew1pqL+n0zNqEKZAly9JB zwrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pZWFd3yS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si1763538ejd.79.2021.07.22.03.42.56; Thu, 22 Jul 2021 03:43:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=pZWFd3yS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231609AbhGVKA4 (ORCPT + 99 others); Thu, 22 Jul 2021 06:00:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230410AbhGVKAz (ORCPT ); Thu, 22 Jul 2021 06:00:55 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8CD2C061575; Thu, 22 Jul 2021 03:41:29 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id m2so5425104wrq.2; Thu, 22 Jul 2021 03:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:reply-to:date:message-id :mime-version; bh=hjjYYUQIehI9VeBc6wX+U/RUbbsWqT6Tuj+xVmXLLJs=; b=pZWFd3ySNfxCmZ3C+m26RZYye81+LV1ZUBwjPTqMES8A6B3CRDREpZYhJcslazcRMk nUmr3IKcjc9XK5dgcHgkWU8xjbyjsTDMwTwSiaR3ahg7T0WSqevXUuaoGsSYSHh3nww8 eO7ueQSWnhY/HfTgK/lDhp5dQHREk5qP/YeFR1NzY5BiA5mLCf1TOi/EjWKkzIB2rExZ XMGBSx2NpZls/tdYvneNNmJivwo7ZMxYZyov+ww7zwVOLojukulUl88x8pm/TVEXdl4Z izNU+KS6E/yYMsTgfwrHnc3i3FYYGx5UvU2YjGMWP4+0tds6QCU55K3+gvLmsAoVekf9 oEaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :reply-to:date:message-id:mime-version; bh=hjjYYUQIehI9VeBc6wX+U/RUbbsWqT6Tuj+xVmXLLJs=; b=VGXA8JrpF2AhBTHOsBXGclcEmkoklNJDON7ORbauALG0X0WxGufB5hoUyEmR+t9qFd CHuQ06Syc/omz+7Z4U5gEyIkyHXtlfZRg5IzLSyCiXwKI4Q1V5R1rD7L26nGSMf9iVL3 UTdZFjyq/M3WB9hQBqlwvDTuDCvKE0jCJE478oYUQgeYx0XHiF5uqe/Cqkniv7CBK230 hBKYbHX3QU/3Ehcj6PnEx8M1QiOLw3hlcMNISszT74Mx8UjWPZHvqavM+RBDjlQ7rDJF G1PBUT8mSFysmVoJ1eJUkBPvl7hZeQtA996mCm2GFezIqKfftc9+6USRwq4tcJScFYyz YXSw== X-Gm-Message-State: AOAM530UsyYT+ZjNfDDofYRZCheml5gRcVYseRbf4GZrqcOsvd0K7Na/ U00nEORIzxvwmjYvI2fXJwms58tMw7I= X-Received: by 2002:a5d:59ab:: with SMTP id p11mr29856058wrr.74.1626950488555; Thu, 22 Jul 2021 03:41:28 -0700 (PDT) Received: from jvdspc.jvds.net ([212.129.84.103]) by smtp.gmail.com with ESMTPSA id p9sm28709072wrx.59.2021.07.22.03.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 03:41:27 -0700 (PDT) Received: from jvdspc.jvds.net (localhost [127.0.0.1]) by jvdspc.jvds.net (8.16.1/8.15.2) with ESMTPS id 16MAfQgf019600 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 11:41:26 +0100 Received: (from jvd@localhost) by jvdspc.jvds.net (8.16.1/8.16.1/Submit) id 16MAfOKU019599; Thu, 22 Jul 2021 11:41:24 +0100 X-Authentication-Warning: jvdspc.jvds.net: jvd set sender to jason.vas.dias@gmail.com using -f From: "Jason Vas Dias" To: Stephen Hemminger Cc: linux-kernel@vger.kernel.org, linux-8086@vger.kernel.org, netdev@vger.kernel.org Subject: Re: /proc/net/{udp,tcp}{,6} : ip address format : RFC : need for /proc/net/{udp,tcp}{,6}{{n,h},{le,be}} ? In-Reply-To: References: Reply-To: "Jason Vas Dias" Date: Thu, 22 Jul 2021 11:41:24 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RE: On 20 July 2021 at 23:41, Stephen Hemminger wrote: >> So, yes what you say makes sense but that was not how the early >> prehistoric (2.4 or earlier) versions of Linux decided to output addresses >> and it can never change. I don't like those words: "it can never change" !:-) How about either or both Options B & C under sysfs then? ie. something like /sys/class/net/{udp,tcp}{,6,n,h,ip,bin} 6: ipv6 [optionally: [ n: hex, network byte order h: hex, host byte order ip: ipv4 ascii dotted quad decimal IPv4 address with ':' suffix, and decimal numbers ip6:ipv6 ascii 32-bit hex words of IPv6 address separated by ':' (or '::') with '#' suffix, with decimal numbers ] [and / or: bin:memory mapped read-only binary table ]] I know ip route and netlink can be used. But since Linux is mandated to print the IP socket and routing tables in ASCII, which I think is a great idea for shell / perl / python / java / nodejs / lisp / "script language X" scripts, in the /proc/net/{udp,tcp}* files, it should net be precluded from providing a better attempt in new files / filesystems - that is all I am suggesting. It is a much more attractive proposition for scripts to parse some ASCII text rather than having to make a call into a native code library or run an executable like 'ip' (iproute2) to use netlink sockets for this ; since Linux has to do this job for the /proc filesystem anyway, why not at least consider then idea of improving & extending this excellent support for scripts , and make their task simpler and more efficient ? ie. they could use one number conversion routine for all numbers in each new file. I'd personally find such tables most useful, and might actually develop a module for them. Especially if they included the netlink IP stats like 64-bit total counts of rx & tx bytes for each socket as well as rx & tx queue lengths. Best Regards, Jason