commit | f833756b388ceeab48a439a244ffa3de0166b6f2 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Tue Sep 05 04:40:20 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Tue Sep 05 04:40:20 2023 +0000 |
tree | 897836674c74faac90707276de61c91a3c2e8c6b | |
parent | fe61083895256485787229a784a56a6f9c1553a8 [diff] | |
parent | c926f5b2ffcdda548241ea633c8d6b77975de1df [diff] |
Snap for 10760240 from c926f5b2ffcdda548241ea633c8d6b77975de1df to mainline-appsearch-release Change-Id: I26b709b2a2736e36ff36023bb6b0824962695609
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: