From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jason Vas Dias" Subject: Re: /proc/net/{udp,tcp}{,6} : ip address format : RFC : need for /proc/net/{udp,tcp}{,6}{{n,h},{le,be}} ? Date: Thu, 22 Jul 2021 11:41:24 +0100 Message-ID: References: Reply-To: "Jason Vas Dias" Mime-Version: 1.0 Return-path: 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== In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Stephen Hemminger Cc: linux-kernel@vger.kernel.org, linux-8086@vger.kernel.org, netdev@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