commit | fe61083895256485787229a784a56a6f9c1553a8 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Fri Jul 14 20:41:39 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Fri Jul 14 20:41:39 2023 +0000 |
tree | e00e76908c9390c398f7ffc6ca31cf93b9aaa8ea | |
parent | 5a685899cde87c8b2796e2cb4cff128b01c1e106 [diff] | |
parent | e107b6ca4d4614084ff2a32db5defe2bc5194bcb [diff] |
Snap for 10499635 from e107b6ca4d4614084ff2a32db5defe2bc5194bcb to mainline-appsearch-release Change-Id: I4bbda8a4af18910699f046ef345268402c54e685
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: