Re: Suggested dual human/binary interface for proc/devfs

George Bonser (grep@shorelink.com)
Tue, 11 Apr 2000 01:32:30 -0700 (PDT)


On Tue, 11 Apr 2000, Ed Carp wrote:

> George Bonser (grep@shorelink.com) writes:
>
> > device{eth0{ip_address=192.168.201.116;netmask=255.255.255.0};eth1{ip_address=192.168.202.117;netmask=255.255.255.0};}
> >
> > or
> >
> > device {
> > eth0 {
> > ip_address=192.168.201.116
> > netmask=255.255.255.0
> > }
> > eth1 {
> > ip_address=192.168.202.117
> > netmask=255.255.255.0
> > }
> > }
> >
> > (same thing)
> >
> > nests better and is more readable and there is already a bunch of code
> > available to parse this format.
> >
> > The logic to parse this should be very easy.
>
> In a shell script? I don't think so. Not nearly as easy as one-device-per-line.

Ok, I am completely miscommunicating to you. That format is NEVER intended
to be seen by a user (though they can get it if they want it). In this
case the output of

pd <file>

might be

DEVICE IP ADDRESS NETMASK

eth0 192.168.201.116 255.255.255.0
eth1 192.168.202.117 255.255.255.0

OR

GROUP1_NAME ATTRIBUTE 1 ATTRIBUTE2 ATTRIBUTE-N

LIST1-NAME DATA-1 DATA-2 DATA-N
LIST2-NAME DATA-1 DATA-2 DATA-N
LISTN-NAME DATA-1 DATA-2 DATA-N

GROUP2_NAME ATTRIBUTE

LIST1_NAME DATA

GROUPN_NAME ...

OR of one does dp --XML

<group1>
<list1>
attribute1=data1
attribute2=data2
attribute3=data3
</list1>
<list2>
attribute1=data1
attribute2=data2
attribute3=data3
</list2>
<listN>
attribute1=data1
attribute2=data2
attribute3=data3
</listN>
<group2>
<list1>
<attribute=data>
</group2>
<groupN>
...

-
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/