commit | 29b367bea511d5160aa6b2c369b8c726196a61d5 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <[email protected]> | Wed Nov 15 08:35:24 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed Nov 15 08:35:24 2023 +0000 |
tree | 40b5fb74851bbe10e4eedcb94a663faf615c15bb | |
parent | d770ef02d402716726c2f4bc1874e0d1b80334dc [diff] | |
parent | ba061c51959fab9f148675a10aebfbe6aee89d31 [diff] |
Merge "Add //tools/netsim:__subpackages__ to extra bp file." into main am: ba061c5195 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-compiler/+/2828247 Change-Id: Ib554d1ff0d26892d41f5759b268cfa23a68f3acb 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: