BitPim's protogen.py seems similar to what you're looking for; its canonical use is for making it easier to communicate with mobile phones (particularly BREW-based GSM models), but its packet description language should be rich enough to handle at least some of the examples you give as is.
The resulting decoders (and encoders, should you have need of them) are in Python. -- Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org) Finger [EMAIL PROTECTED] (NOT a valid e-mail address) for more info. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]