commit | 544c0c5c4b797eab040f88b1cf751ca1836c1fb8 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <[email protected]> | Wed Nov 15 09:56:05 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed Nov 15 09:56:05 2023 +0000 |
tree | 40b5fb74851bbe10e4eedcb94a663faf615c15bb | |
parent | 57276d0c72f294b4bb3ad2eba51683488261cedf [diff] | |
parent | e821f365b7e6ac43679c408a5beaba15657a5a85 [diff] |
Merge "Add //tools/netsim:__subpackages__ to extra bp file." into main am: ba061c5195 am: 1758121abc am: e821f365b7 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/pdl-compiler/+/2828247 Change-Id: If6daab41271203d8d1d12427482c75f1157d1289 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: