cvs commit: src/lib/libcaps caps_msgbuf.c caps_pwent.c caps_struct.c caps_struct.h Makefile defs.h globaldata.c globaldata.h caps_client.c caps_misc.c caps_service.c src/test/caps decoder.c encoder.c Makefile
Matthew Dillon
dillon at crater.dragonflybsd.org
Sun Mar 7 15:37:41 PST 2004
dillon 2004/03/07 15:36:45 PST
DragonFly src repository
Modified files:
lib/libcaps Makefile defs.h globaldata.c globaldata.h
test/caps Makefile
Added files:
lib/libcaps caps_msgbuf.c caps_pwent.c caps_struct.c
caps_struct.h
test/caps decoder.c encoder.c
Removed files:
lib/libcaps caps_client.c caps_misc.c caps_service.c
Log:
Initial CAPS IPC structural encoding and decoding support. Note that the
kernel is uninvolved (other then in supplying the IPC mechanism). After
careful consideration I decided that XML was just too much overkill but that
a human-readable format is still desireable. The encoding format supports
integers, strings, opaque data, arrays, and is extensible and structural.
An example encoding of the struct passwd record for user 'nobody':
Spasswd{F1D"nobody",F2D"%2a",F3Dfffe,F4Dfffe,F5D0,F6D"",F7D"Unprivileged%20user",F8D"/nonexistent",F9D"/sbin/nologin",FaD0}
Class elements include (S)tructure, (F)ield, (D)ata, (A)rray. Data types are
free-form numeric (stored as hex), with the source responsible for encoding
negative numbers with a '-', and quoted opaque data (e.g. strings). Any
class element may recurse using {}. Structures and Arrays always recurse.
Unknown recursions are ignored by the decoder (for future backwards
compatibility). Whitespace is allowed but most non-alpha-numeric characters
must be %-hex-escaped.
The decoder understands simple integer types, arrays, buffers, embedded
sub-structures, and string pointer structural elements. It does not (yet)
understand multi-dimensional arrays, sparse element notation, or ** pointers.
This is a nice, compact encoding format that can be used for both packetized
messages and persistently-connected streams. The initial commit only supports
full-messages, however.
Revision Changes Path
1.5 +3 -2 src/lib/libcaps/Makefile
1.4 +3 -19 src/lib/libcaps/defs.h
1.4 +2 -2 src/lib/libcaps/globaldata.c
1.6 +4 -1 src/lib/libcaps/globaldata.h
1.6 +7 -1 src/test/caps/Makefile
http://www.dragonflybsd.org/cvsweb/src/lib/libcaps/Makefile.diff?r1=1.4&r2=1.5&f=h
http://www.dragonflybsd.org/cvsweb/src/lib/libcaps/defs.h.diff?r1=1.3&r2=1.4&f=h
http://www.dragonflybsd.org/cvsweb/src/lib/libcaps/globaldata.c.diff?r1=1.3&r2=1.4&f=h
http://www.dragonflybsd.org/cvsweb/src/lib/libcaps/globaldata.h.diff?r1=1.5&r2=1.6&f=h
http://www.dragonflybsd.org/cvsweb/src/test/caps/Makefile.diff?r1=1.5&r2=1.6&f=h
More information about the Commits
mailing list