Re: ARMS WAVING!!! Proposal to fix /proc dainbrammage.

Matti Aarnio (matti.aarnio@sonera.fi)
Wed, 28 Oct 1998 16:15:58 +0200 (EET)


Linus Torvalds is on a high horse:
> On Fri, 23 Oct 1998, Perry Harrington wrote:
> > Everyone knows that big endian byte ordering is sane for a /proc interface,
> > because /proc is designed to be an interface to humans. Besides, we're
> > taught in big endian format as programmers.
>
> No, we really want to use dot-format for internet addresses, and decimal
> numbers for port numbers etc. /proc should really be the format humans
> use: whenever you even have a _question_ of what the number means, it's
> wrong.
>
> So both "7f000001:0400" and "0100007f:0004" are wrong, "127.0.0.1:1024"
> is right.

No. The /proc/net/tcp are 32-bit hex-encoded integers
containing network byte order values, and that is due to
TRADITION (as braindead as it is).

The /proc/net/tcp6 on the other hand uses network byte order
hex-encoded octet arrays. They are *not* integers! (128 bits)

Of course we can do the change, and if we do it, my vote goes
to doing it in clean network-byte-order hex-encoded octet form.
(Even with all the pain it causes to the nettools maintainers,
AND users who must realize the need to upgrade.)

The port numbers on the other hand are 16 bit unsigned integers
in machine byte order.

> Yes, its a bit harder to parse for computers, but hey, that's what
> computers are good at.

One other thing is that with fixed size presentation results
we get much less headaches within the kernel when producing
these report texts, but your forgetting of that is surely just
a lapse of memory ?

> Linus

/Matti Aarnio <matti.aarnio@sonera.fi>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/