dehorsley / packgen

One small step above casting a buffer to a struct

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

packgen: generate C struct packing and unpacking

One small step above casting a buffer to a struct.

This is a tool takes a file containing struct type definitions and generates routines to pack and unpack the structures.

Assumptions made by the generator:

  • structs you want to unpack are typedef'd
  • contain no anonymous embedded structs (this assumption should be easily removed if needed)
  • C99 fixed width types are used (you really should use these everywhere that might be exposed)
  • no variable length data

If you are designing a communication protocol, don't use this. Use something like protobuf, msgpack, or json

This includes pycparser's fake libc headers for convenience. Those are covered under their own license.

The main program licensed under GPL 3.

About

One small step above casting a buffer to a struct

License:GNU General Public License v3.0


Languages

Language:C 39.1%Language:Python 36.9%Language:C++ 24.0%