commit | d4d92a96b2f190ec5b41a233ac80efa16ba01ac0 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Thu Nov 16 02:14:15 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Thu Nov 16 02:14:15 2023 +0000 |
tree | 40b5fb74851bbe10e4eedcb94a663faf615c15bb | |
parent | e07ffbe079d54cafef9746f5c9a4126c99fa1983 [diff] | |
parent | 75618274e9e33762f16caa49747c70cd5969866d [diff] |
Snap for 11105317 from 75618274e9e33762f16caa49747c70cd5969866d to 24D1-release Change-Id: I50430ce18cec03fb8a0a8a9ab3e048de0f5b86fa
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: