commit | 28953123fda90c7b330156af2e71a61aa3ebc572 | [log] [tgz] |
---|---|---|
author | Henri Chataing <[email protected]> | Tue Oct 24 10:28:04 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Oct 24 10:28:04 2023 +0000 |
tree | 19bc6fbb8b36697fc0c5352fc51cc233385b885c | |
parent | 18ee7a9e1cce70a3839dd2a519d3c1301d682b2c [diff] | |
parent | 0016ad9d34c201768cca3f713def4d671a7a6f05 [diff] |
Import platform/external/rust/crates/pdl-runtime am: 42955e2a20 am: ed40f8e3bf am: 0016ad9d34 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-runtime/+/2799356 Change-Id: I6870c1032e3152402d357305a797acb6ea52facf Signed-off-by: Automerger Merge Worker <[email protected]>
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: