Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 May 2007 18:39:34 +0200
From:      Ivan Voras <ivoras@fer.hr>
To:        freebsd-hackers@freebsd.org
Subject:   MIME-ifying sysctl types
Message-ID:  <f1nko6$1v2$1@sea.gmane.org>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig7CF7858D4EB10347BFBC0CF8
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

In the output of sysctl -oa I see values like:

kern.proc.all: Format:S,proc Length:75264
Dump:0x00030000000000002011fac380d4fec3...
kern.proc.proc_td: Format:N Length:75264
Dump:0x00030000000000002011fac380d4fec3...
kern.file: Format:S,xfile Length:18616
Dump:0x340000003e0c0000e803000006000000...
vfs.nfs.diskless_rootaddr: Format:%Ssockaddr_in Length:16
Dump:0x00000000000000000000000000000000...
debug.hashstat.rawnchash: Format:S,int Length:262144
Dump:0x00000000000000000000000000000000...

, etc., and some like:

kern.ipc.msqids: Format: Length:3520
Dump:0x00000000000000000000000000000000...
kern.ipc.sema: Format: Length:600 Dump:0x00000000000000000000000000000000=
=2E..

and even some like:
machdep.consdev: Format:T,struct cdev * Length:4 Dump:0x00000000...

The first group has widely nonuniform "Format" fields, the second don't
have it at all, and the third just looks wrong (is that a NULL pointer
being exported from the kernel, just in case the userland doesn't have
it? :) ).

My proposal is to MIME-ify the Format fields, best presented in examples:=


"S,proc" -> "x-struct/proc"
"S,xfile" -> "x-struct/xfile"

Etc.

GEOM tree is the easiest, it's just "text/xml", and the already present
text fields would be "text/plain".

If possible, the types should conform to
http://www.iana.org/assignments/media-types/ - but except for text and
XML types they usually won't.

The next step, obviously, but of dubious benefit, would be to stop
exporting binary data from the kernel and do it via XML, but that's
another thing, possibly another GSoC proposal :)

I can provide the patches for the format names. At this time I'm looking
for input: is this idea sane? Are there any utilities that actually
parse the type name?

The benefit of this conversion is that MIME types are easier on the eyes
and will help unfamiliar users understand what's going on.


--------------enig7CF7858D4EB10347BFBC0CF8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGP1ZGldnAQVacBcgRAvZwAKCbB0K89B2a80yVfjqATZIBotZpxgCbB+Cs
XS/NOYjnPeWTpm9k9XqNMdQ=
=bsyG
-----END PGP SIGNATURE-----

--------------enig7CF7858D4EB10347BFBC0CF8--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f1nko6$1v2$1>