commit | f478cbef7cf8b0ebce80b5bc2004d0c9b01f50c2 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Apr 11 18:16:41 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Apr 11 18:16:41 2024 +0000 |
tree | f91c5674b32b7c7960b0bccab434426de019774b | |
parent | ae5f09492bf6865d6954f16e12347419ff4af7ee [diff] | |
parent | 8ced8b9d88e6817bcceed48e114a3eb9655bda26 [diff] |
Snap for 11702928 from 8ced8b9d88e6817bcceed48e114a3eb9655bda26 to emu-34-2-release Change-Id: I4b0522413a13ec53baaffbf86e5c5090a13fff03
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: