commit | 8eda625c693881890c975c09032a6e60fce18eb4 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Mon Nov 06 20:21:04 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Mon Nov 06 20:21:04 2023 +0000 |
tree | 897836674c74faac90707276de61c91a3c2e8c6b | |
parent | 624e24ebdc91cb81ce18655ca23d6de569e3909e [diff] | |
parent | 5ad493ce1a6d335af300f7a2b6369b0a9de317f4 [diff] |
Snap for 11028996 from 5ad493ce1a6d335af300f7a2b6369b0a9de317f4 to mainline-permission-release Change-Id: If099d6ce8da80a9e0a0f0db614c5063da1db3be2
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: