commit | fd345af7c2ebeafe56ab2a603eb74bc406c9cd74 | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Thu Oct 05 19:07:11 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Oct 05 19:07:11 2023 +0000 |
tree | 897836674c74faac90707276de61c91a3c2e8c6b | |
parent | 07f0a684a815ccbb6c00a1211f9e659a8c23f57f [diff] | |
parent | 198facdd02039c5ebbc91ab1430185dbdb9ef8f4 [diff] |
Empty Merge Android U (ab/10368041) am: 198facdd02 Original change: https://googleplex-android-review.googlesource.com/c/platform/external/rust/crates/pdl-compiler/+/24087867 Change-Id: If9a14eaae34c3115aaed9815367f28293bb069fe 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: