commit | f96ab1a87167ca25f9b59a09e6c0f8abb0a12153 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Mon Jul 17 22:22:32 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Mon Jul 17 22:22:32 2023 +0000 |
tree | e00e76908c9390c398f7ffc6ca31cf93b9aaa8ea | |
parent | b7b558d0ca19c8afece3ac20198d9795d3d78419 [diff] | |
parent | afcefe6794d7b84ca0fabd35fa05517e77be7015 [diff] |
Snap for 10509072 from afcefe6794d7b84ca0fabd35fa05517e77be7015 to emu-33-release Change-Id: I6905aee10de239f30e69d7f8986ee2b1178f191c
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: