The datagram library looks like a pretty reasonable point in the design space for packet parsing to me.

There seem to be two extremes:
1. Low-level with one massive C struct/union describing every possible kind of packet.
2. High-level with all packet headers becoming Lua dictionaries and all values Lua values.

and, if I understand correctly, this design basically puts a Lua API over raw memory accessed via C structs.

Am I on the right track so far?