commit | f559097558816962eacb852e7ecc2b5793fb0697 | [log] [tgz] |
---|---|---|
author | Henri Chataing <henrichataing@google.com> | Wed Jun 21 21:35:45 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jun 21 21:35:45 2023 +0000 |
tree | 2df2fcbccd2392d4681c8ae8ff7004a2583a8bd3 | |
parent | df272a76f93285e6d7a78746870c75abc0206795 [diff] | |
parent | 57dd65382caf1a46525460d9de34952f2a01fcea [diff] |
Update pdl-compiler to 0.1.2 am: e6036688e2 am: 57dd65382c Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-compiler/+/2630734 Change-Id: I4faf6458b3d741b2dee0b69203fad711ff320d8d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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: