commit | c3e01062da960236d4abdff7cb007a4c52c585c3 | [log] [tgz] |
---|---|---|
author | Henri Chataing <henrichataing@google.com> | Tue Oct 24 10:00:13 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Oct 24 10:00:13 2023 +0000 |
tree | 19bc6fbb8b36697fc0c5352fc51cc233385b885c | |
parent | 0016ad9d34c201768cca3f713def4d671a7a6f05 [diff] | |
parent | a0dbf075f8502d9220d07e2989d6ca460bfb8291 [diff] |
Import platform/external/rust/crates/pdl-runtime am: 42955e2a20 am: a0dbf075f8 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-runtime/+/2799356 Change-Id: I87253784a260dc52ba21399536d5ea75f3d1ebbc 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: