Semantix ASN.1 compiler
The Semantix ASN.1 compiler is an open source ASN.1 compiler that generates unaligned PER, ACN, BER and XER encoders and decoders for the C and Ada programming languages that make (a) no calls to malloc() or to any other function that allocates memory dynamically and (b) no system calls, thus creating perfectly portable code, suitable to run in space.
The Semantix ASN.1 compiler achieves the "no dynamic memory" goal by applying simple principles:
- The generated C/Ada structures do not contain any pointers.
- All fields are either primitive types or bounded arrays or other structures that don't include any pointers.
- The maximum number of bytes required for encoding any ASN.1 type in unaligned PER or ACN is determined by the compiler during the grammar processing and is available via a generated macro. In this manner, the size of all required memory, for both the C/Ada data structures as well as the buffers where the output streams will be written, is known at compile time and consequently, all memory can be reserved statically (in global space or "static" space).
You can download the latest version of Semantix ASN.1 compiler from here.
Support for legacy (non-ASN.1) protocols
The Semantix ASN.1 compiler offers another significant feature: It allows protocol designers (via ACN) to control the format of the encoded messages at the bit level - and thus allows integration with existing legacy applications.
More information about ACN and and how to use it along with the compiler can be found here.
License information for the Semantix ASN.1 compiler is here