commit | 3f60b2bd88bbb40ba18384197e666e2928014fea | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Tue Aug 01 18:45:14 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Tue Aug 01 18:45:14 2023 +0000 |
tree | 4f8100c2b466e8c2224dd1df8cfe19881eb9c970 | |
parent | f96ab1a87167ca25f9b59a09e6c0f8abb0a12153 [diff] | |
parent | 3f09ffba338db94c0f3b766cb9e6f610238a751b [diff] |
Snap for 10591065 from 3f09ffba338db94c0f3b766cb9e6f610238a751b to emu-33-release Change-Id: Ib9bc7f3a0d5f1cfc8b15cf6be1b317b3391cf7d9
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: