Scripts to generate TPM structure marshaling code
- These scripts were taken from the platform2/trunks project and
modified to generate marshaling code for libtpm2.
- extract_structures.sh:
* Takes in a hand fixed, raw scrape of TPM2.0 spec part 2, and
outputs a readable file representing spec defined types.
* Input: raw_structures_fixed.txt
* Output: structures.txt
- structure_generator.py
* Takes in a structured representation of TPM2.0 spec part 2,
and outputs C code to marshal and unmarshal all TPM types.
* Input: structures.txt
* Output: tpm_generated.c, tpm_generated.h
- tpm_generated.c and tpm_generated.h are seen in CL:282042
TEST=Visually inspected output of extract_structures.sh.
$ ./structure_generator_test.py
Passes all generator unit tests
BUG=chromium:501639
Change-Id: Ib5a9e1d0e29271cd854b333e1d832bf2013c1098
Reviewed-on: https://chromium-review.googlesource.com/284875
Reviewed-by: Darren Krahn <[email protected]>
Commit-Queue: Jocelyn Bohr <[email protected]>
Tested-by: Jocelyn Bohr <[email protected]>
7 files changed