commit | 5d3f89b2cf601965bf781f45bf386d7d92447387 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Wed Jun 05 00:10:46 2024 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Wed Jun 05 00:10:46 2024 +0000 |
tree | cfba6e67bace17fd08ec4517651366aa49ce9ac3 | |
parent | 704dad0c9b7458e4ca01550f3099fdeeb6da02a6 [diff] | |
parent | d4c1eefd89cf7be07f6aabf428eec2aba916cc61 [diff] |
Snap for 11926388 from d4c1eefd89cf7be07f6aabf428eec2aba916cc61 to 24Q3-release Change-Id: I67dc3ee6a363b5f48722967b26d740dd78b07822
PDL is a domain specific language for writing the definition of binary protocol packets. Parsing and validating packets from raw bytes is tedious and error prone in any language. PDL generates memory safe and tailored backends for multiple target languages:
- Rust - C++ - Python
Historically PDL was developed as part of the Android Bluetooth stack (bluetooth_packetgen) as a way to generate the parser and serializer for Bluetooth packets, and reduce the number of memory safety issues that come with manipulating and validating raw data.
cargo run my-protocol.pdl --output-format rust > my-protocol.rs
Language specific instructions are provided for all supported backends: