commit | b422784c485880ee1a6e420fed180839f1f33fcd | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Sat Sep 02 07:15:59 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Sat Sep 02 07:15:59 2023 +0000 |
tree | 897836674c74faac90707276de61c91a3c2e8c6b | |
parent | fb7ba4cc04d09f31e3eb60bffc412b9c5498f77f [diff] | |
parent | c926f5b2ffcdda548241ea633c8d6b77975de1df [diff] |
Snap for 10754184 from c926f5b2ffcdda548241ea633c8d6b77975de1df to mainline-adservices-release Change-Id: Ie2d0fb6f06997d07cd6ecf2a2e828e34cef554f0
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: