Machine friendly format for /proc files

Elwyn B Davies (edavies@origin-at.co.uk)
Mon, 17 Feb 97 16:34:28 GMT


We are in the process of creating an SNMP agent using the UCSD SNMP code
(specifically for the AToM MIB). Much of the information to be returned by
accesses to this agent comes from various /proc files.

Clearly this is a very clean and convenient solution compared with typical
UNIX solutions which involve the agent itself fishing around inside the kernel
to retrieve info from (usually undocumented and unsupported) locations in the
memory map.

Unfortunately the format of the various /proc files is pretty much ad hoc and
primarily intended to be human readable rather than machine readable. It is
also essentially unsupported - it is not a specifically documented and
maintained interface - so in some ways it is just as bad as fishing around in
the kernel directly. The agent has to be aware of the format of each file and
provide specific decoding for the format provided by the device driver writer.
Accordingly, a minor change to the format can break the agent.

We propose that it would be very convenient if a more machine friendly and
standardised format was added to the /proc files. Something like the
M****soft Windows initialisation file format is what we would be looking for
(surely they didn't get something right ;-) with parameter/value pairs divided
into sections plus comment facilities.

The existing human readable output could be retained as comment either up
front (less likely to break existing programs) or tacked on the end (easier to
read after cat /proc/xxx)..

Any views?

Regards,
Elwyn Davies

------------------------------------------------------------------------
Elwyn B Davies MA
Senior Consultant
Origin UK/TA Cambridge
(Technical Automation Cell)
Tel: +44 1223 423355
Fax: +44 1223 420724
Email: edavies@origin-at.co.uk

"The Folly is mostly mine"
------------------------------------------------------------------------