commit | b7b558d0ca19c8afece3ac20198d9795d3d78419 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Thu Jun 22 17:08:55 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Thu Jun 22 17:08:55 2023 +0000 |
tree | 2df2fcbccd2392d4681c8ae8ff7004a2583a8bd3 | |
parent | ce54c6fdd7fa7990384b7c2eb03e1b2ff5e0930f [diff] | |
parent | 57dd65382caf1a46525460d9de34952f2a01fcea [diff] |
Snap for 10363732 from 57dd65382caf1a46525460d9de34952f2a01fcea to emu-33-release Change-Id: I1d574653d188a37cf9cab9ad34576b7f73fcdde7
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: