commit | fb2d9c330281aceaa69a43c515fa64554966444d | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Fri Nov 17 02:12:57 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Fri Nov 17 02:12:57 2023 +0000 |
tree | d261c5021cf1151e37b78b4c190a16037bd0575e | |
parent | d4d92a96b2f190ec5b41a233ac80efa16ba01ac0 [diff] | |
parent | e5f3986d1e740294e1dcc174b54d50e2a1fe841f [diff] |
Snap for 11111752 from e5f3986d1e740294e1dcc174b54d50e2a1fe841f to 24D1-release Change-Id: Icb6310dc9bad08c675d4c89f27ef51078292073c
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: