Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Jason Vas Dias" <jason.vas.dias@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
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}} ?
Date: Thu, 22 Jul 2021 11:41:24 +0100	[thread overview]
Message-ID: <hhwnpir5pn.fsf@jvdspc.jvds.net> (raw)
In-Reply-To: <hhlf60vmj6.fsf@jvdspc.jvds.net>


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 ':' <port>
       suffix, and decimal numbers         
   ip6:ipv6 ascii 32-bit hex words of IPv6 address separated by ':' (or
       '::') with '#' <port> 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










      parent reply	other threads:[~2021-07-22 10:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 18:59 Jason Vas Dias
2021-07-20 22:41 ` Stephen Hemminger
2021-07-22 10:41 ` Jason Vas Dias [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=hhwnpir5pn.fsf@jvdspc.jvds.net \
    --to=jason.vas.dias@gmail.com \
    --cc=linux-8086@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --subject='Re: /proc/net/{udp,tcp}{,6} : ip address format : RFC : need for /proc/net/{udp,tcp}{,6}{{n,h},{le,be}} ?' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).